import{a as jc}from"./chunk-AS4FOB5O.js";import{a as Sa,b as pc,c as He}from"./chunk-WRAZXVSS.js";import{a as ac,b as oc,c as lc,d as Lr,e as kr}from"./chunk-TUA6JPIE.js";import{a as ve,i as Bc,l as Hc}from"./chunk-WHW7BIEM.js";import"./chunk-2NM4ZPFZ.js";import{a as nn}from"./chunk-MUGFRIQE.js";import{a as ot,b as Yi,c as Wt,d as Ke,e as Fe,f as ci,i as mc,j as Pr}from"./chunk-TH3VGOEN.js";import{a as pe}from"./chunk-OQPUNG3P.js";import{a as ne}from"./chunk-BG54XANT.js";import{A as xc,B as tn,C as Dc,D as Lc,E as kc,F as xa,G as Da,H as Pc,I as Oc,J as Mc,K as Nc,L as Fc,M as Vc,N as $c,O as Or,P as Uc,Q as y,a as Mn,b as fc,c as Ia,d as Qi,e as gc,f as _c,g as Cc,h as vc,i as Ta,j as wa,k as Ji,l as bc,m as yc,n as Sc,o as Ic,p as Tc,q as wc,r as Ec,s as en,t as Ea,u as Ac,v as Aa,w as Ra,x as Nn,y as L,z as Rc}from"./chunk-A5HC6LBU.js";import{a as ft}from"./chunk-CD5MRQDF.js";import{a as g,b as Je,c as Dt,d as et}from"./chunk-G4YFIQHZ.js";import{a as Qt,b as ya,c as nc,d as rc,e as sc}from"./chunk-MQLFPFWD.js";import"./chunk-GLDDIEOO.js";import"./chunk-VIXTIIIM.js";import"./chunk-VV65LCWT.js";import"./chunk-GW3WNYJ2.js";import"./chunk-GGY7N3EO.js";import"./chunk-QNEM6BC7.js";import"./chunk-VS4EM4IM.js";import"./chunk-KG5GTMNR.js";import"./chunk-4FYZKSM7.js";import"./chunk-ZINII5IZ.js";import"./chunk-ANPDUHZ7.js";import"./chunk-63SPW2MZ.js";import"./chunk-RNUBIND2.js";import"./chunk-7GOYYYKT.js";import"./chunk-HFYKKTGW.js";import"./chunk-ALRLDKLP.js";import"./chunk-JSWEBIIT.js";import"./chunk-AJRCP3N5.js";import"./chunk-CE2DOHH7.js";import"./chunk-IYVPMYIC.js";import"./chunk-DGHKLZ25.js";import"./chunk-2KWN7RTB.js";import"./chunk-HPZS3H7P.js";import"./chunk-WFQCMMJP.js";import"./chunk-LUKAGZYC.js";import"./chunk-EUF5INSM.js";import"./chunk-3X4CVBBA.js";import"./chunk-UONIVJLD.js";import"./chunk-JHMTSV4D.js";import"./chunk-VTGKAHD7.js";import"./chunk-Q6ZK426Q.js";import"./chunk-HCYSTHCF.js";import{c as cc,d as dc,f as uc,g as hc}from"./chunk-PUAS7KUQ.js";import{$ as Rl,$a as Ki,$b as va,A as Tl,Aa as Ir,Ac as Ai,B as Tt,Ba as Ol,Bb as F,Cb as O,Cc as xt,D as Pe,Da as Ti,Db as X,Dc as ec,E as Xe,Ea as Ut,Eb as Et,Ec as Ri,F as ca,Fb as At,Fc as xi,G as me,Ga as nt,Gb as Ye,Gc as Yt,H as Dn,Ha as ce,Hb as pt,Hc as tc,I as wl,Ia as de,Ib as xe,Ic as Xi,J as El,Ja as oi,Jb as w,K as ge,Ka as ze,Kb as mt,Kc as at,L as si,La as Ml,Lb as Qe,M as Cr,Ma as Zt,Mb as rt,Mc as ic,N as zi,Na as Tr,Nb as Rt,O as da,Oa as Nl,Ob as Te,P as ie,Pa as W,Pb as we,Q as Al,Qa as Re,Qb as Ht,R as vr,Rb as Ee,S as Wi,Sa as Fl,Sb as Ei,T as Si,Ta as Ie,Tb as jt,Ub as zl,V as ua,Vb as zt,W as br,Wb as ue,X as ai,Xa as ut,Xb as Wl,Y as ha,Ya as Vl,Yb as st,Z as Ln,Za as $l,Zb as _a,_a as fa,_b as Ca,a as qt,aa as yr,ab as Ul,ac as Ar,ba as Sr,bb as wr,bc as Gl,c as Sl,ca as kn,cc as Kl,d as Hi,da as Gi,db as I,dc as Zi,e as aa,ea as xl,eb as S,ec as ba,f as oa,fa as Ii,fb as Er,fc as Rr,g as B,ga as ee,gb as Bt,gc as xr,h as te,ha as Ue,hb as Bl,hc as ql,ia as Dl,ib as qi,j as la,ja as H,jb as ht,jc as Ne,k as dt,kb as wi,l as $e,la as Oe,lb as Hl,lc as J,m as C,ma as E,mc as Ge,n as bi,na as _e,nb as Me,o as Vt,oa as Ll,ob as Xt,p as Il,pa as ae,pb as Be,pc as Dr,qa as pa,qb as jl,qc as Zl,ra as D,rb as ga,rc as Xl,sa as b,sb as $,ta as kl,tb as li,u as R,ua as Pl,ub as Z,v as $t,vb as v,vc as fe,w as ke,wa as Q,wb as Pn,wc as Yl,x as xn,xa as Ce,xb as We,xc as On,y as yi,ya as Se,yb as wt,yc as Ql,z as ji,za as ma,zc as Jl}from"./chunk-5YZ7JJB7.js";import"./chunk-LOSCZPSK.js";import"./chunk-CWORUXGY.js";import"./chunk-VIP7RRFR.js";import"./chunk-47OKNGMD.js";import"./chunk-O6ANA3P3.js";import"./chunk-V3REPDZI.js";import"./chunk-HSATI3VG.js";import"./chunk-322BFM27.js";import"./chunk-T25TFZYD.js";import"./chunk-MM3XXTW2.js";import{a as f,b as j,l as Ze,n as se}from"./chunk-GZHIIU54.js";var qh="@",Zh=(()=>{class r{constructor(e,i,n,s,a){this.doc=e,this.delegate=i,this.zone=n,this.animationType=s,this.moduleImpl=a,this._rendererFactoryPromise=null,this.scheduler=b(Bl,{optional:!0}),this.loadingSchedulerFn=b(Xh,{optional:!0})}ngOnDestroy(){this._engine?.flush()}loadImpl(){let e=()=>this.moduleImpl??import("./chunk-O6QIAFBV.js").then(n=>n),i;return this.loadingSchedulerFn?i=this.loadingSchedulerFn(e):i=e(),i.catch(n=>{throw new Oe(5300,!1)}).then(({\u0275createEngine:n,\u0275AnimationRendererFactory:s})=>{this._engine=n(this.animationType,this.doc);let a=new s(this.delegate,this._engine,this.zone);return this.delegate=a,a})}createRenderer(e,i){let n=this.delegate.createRenderer(e,i);if(n.\u0275type===0)return n;typeof n.throwOnSyntheticProps=="boolean"&&(n.throwOnSyntheticProps=!1);let s=new La(n);return i?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(a=>{let o=a.createRenderer(e,i);s.use(o),this.scheduler?.notify(10)}).catch(a=>{s.use(n)}),s}begin(){this.delegate.begin?.()}end(){this.delegate.end?.()}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}static{this.\u0275fac=function(i){Er()}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac})}}return r})(),La=class{constructor(t){this.delegate=t,this.replay=[],this.\u0275type=1}use(t){if(this.delegate=t,this.replay!==null){for(let e of this.replay)e(t);this.replay=null}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}get destroyNode(){return this.delegate.destroyNode}appendChild(t,e){this.delegate.appendChild(t,e)}insertBefore(t,e,i,n){this.delegate.insertBefore(t,e,i,n)}removeChild(t,e,i){this.delegate.removeChild(t,e,i)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,i,n){this.delegate.setAttribute(t,e,i,n)}removeAttribute(t,e,i){this.delegate.removeAttribute(t,e,i)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,i,n){this.delegate.setStyle(t,e,i,n)}removeStyle(t,e,i){this.delegate.removeStyle(t,e,i)}setProperty(t,e,i){this.shouldReplay(e)&&this.replay.push(n=>n.setProperty(t,e,i)),this.delegate.setProperty(t,e,i)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,i){return this.shouldReplay(e)&&this.replay.push(n=>n.listen(t,e,i)),this.delegate.listen(t,e,i)}shouldReplay(t){return this.replay!==null&&t.startsWith(qh)}},Xh=new ae("");function zc(r="animations"){return Hl("NgAsyncAnimations"),Ir([{provide:qi,useFactory:(t,e,i)=>new Zh(t,e,i,r),deps:[fe,ac,Re]},{provide:Vl,useValue:r==="noop"?"NoopAnimations":"BrowserAnimations"}])}var q="primary",Yn=Symbol("RouteTitle"),Na=class{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){let e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){let e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}};function cn(r){return new Na(r)}function Yh(r,t,e){let i=e.path.split("/");if(i.length>r.length||e.pathMatch==="full"&&(t.hasChildren()||i.lengthi[s]===n)}else return r===t}function nd(r){return r.length>0?r[r.length-1]:null}function ui(r){return Vt(r)?r:Kl(r)?$e(Promise.resolve(r)):C(r)}var Jh={exact:sd,subset:ad},rd={exact:ep,subset:tp,ignored:()=>!0};function Wc(r,t,e){return Jh[e.paths](r.root,t.root,e.matrixParams)&&rd[e.queryParams](r.queryParams,t.queryParams)&&!(e.fragment==="exact"&&r.fragment!==t.fragment)}function ep(r,t){return Gt(r,t)}function sd(r,t,e){if(!Li(r.segments,t.segments)||!Fr(r.segments,t.segments,e)||r.numberOfChildren!==t.numberOfChildren)return!1;for(let i in t.children)if(!r.children[i]||!sd(r.children[i],t.children[i],e))return!1;return!0}function tp(r,t){return Object.keys(t).length<=Object.keys(r).length&&Object.keys(t).every(e=>id(r[e],t[e]))}function ad(r,t,e){return od(r,t,t.segments,e)}function od(r,t,e,i){if(r.segments.length>e.length){let n=r.segments.slice(0,e.length);return!(!Li(n,e)||t.hasChildren()||!Fr(n,e,i))}else if(r.segments.length===e.length){if(!Li(r.segments,e)||!Fr(r.segments,e,i))return!1;for(let n in t.children)if(!r.children[n]||!ad(r.children[n],t.children[n],i))return!1;return!0}else{let n=e.slice(0,r.segments.length),s=e.slice(r.segments.length);return!Li(r.segments,n)||!Fr(r.segments,n,i)||!r.children[q]?!1:od(r.children[q],t,s,i)}}function Fr(r,t,e){return t.every((i,n)=>rd[e](r[n].parameters,i.parameters))}var ei=class{constructor(t=new re([],{}),e={},i=null){this.root=t,this.queryParams=e,this.fragment=i}get queryParamMap(){return this._queryParamMap??=cn(this.queryParams),this._queryParamMap}toString(){return rp.serialize(this)}},re=class{constructor(t,e){this.segments=t,this.children=e,this.parent=null,Object.values(e).forEach(i=>i.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return Vr(this)}},Di=class{constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap??=cn(this.parameters),this._parameterMap}toString(){return cd(this)}};function ip(r,t){return Li(r,t)&&r.every((e,i)=>Gt(e.parameters,t[i].parameters))}function Li(r,t){return r.length!==t.length?!1:r.every((e,i)=>e.path===t[i].path)}function np(r,t){let e=[];return Object.entries(r.children).forEach(([i,n])=>{i===q&&(e=e.concat(t(n,i)))}),Object.entries(r.children).forEach(([i,n])=>{i!==q&&(e=e.concat(t(n,i)))}),e}var Qn=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:()=>new dn,providedIn:"root"})}}return r})(),dn=class{parse(t){let e=new $a(t);return new ei(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){let e=`/${Fn(t.root,!0)}`,i=op(t.queryParams),n=typeof t.fragment=="string"?`#${sp(t.fragment)}`:"";return`${e}${i}${n}`}},rp=new dn;function Vr(r){return r.segments.map(t=>cd(t)).join("/")}function Fn(r,t){if(!r.hasChildren())return Vr(r);if(t){let e=r.children[q]?Fn(r.children[q],!1):"",i=[];return Object.entries(r.children).forEach(([n,s])=>{n!==q&&i.push(`${n}:${Fn(s,!1)}`)}),i.length>0?`${e}(${i.join("//")})`:e}else{let e=np(r,(i,n)=>n===q?[Fn(r.children[q],!1)]:[`${n}:${Fn(i,!1)}`]);return Object.keys(r.children).length===1&&r.children[q]!=null?`${Vr(r)}/${e[0]}`:`${Vr(r)}/(${e.join("//")})`}}function ld(r){return encodeURIComponent(r).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Mr(r){return ld(r).replace(/%3B/gi,";")}function sp(r){return encodeURI(r)}function Va(r){return ld(r).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function $r(r){return decodeURIComponent(r)}function Gc(r){return $r(r.replace(/\+/g,"%20"))}function cd(r){return`${Va(r.path)}${ap(r.parameters)}`}function ap(r){return Object.entries(r).map(([t,e])=>`;${Va(t)}=${Va(e)}`).join("")}function op(r){let t=Object.entries(r).map(([e,i])=>Array.isArray(i)?i.map(n=>`${Mr(e)}=${Mr(n)}`).join("&"):`${Mr(e)}=${Mr(i)}`).filter(e=>e);return t.length?`?${t.join("&")}`:""}var lp=/^[^\/()?;#]+/;function ka(r){let t=r.match(lp);return t?t[0]:""}var cp=/^[^\/()?;=#]+/;function dp(r){let t=r.match(cp);return t?t[0]:""}var up=/^[^=?&#]+/;function hp(r){let t=r.match(up);return t?t[0]:""}var pp=/^[^&#]+/;function mp(r){let t=r.match(pp);return t?t[0]:""}var $a=class{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new re([],{}):new re([],this.parseChildren())}parseQueryParams(){let t={};if(this.consumeOptional("?"))do this.parseQueryParam(t);while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let i={};return this.peekStartsWith("(")&&(i=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(i[q]=new re(t,e)),i}parseSegment(){let t=ka(this.remaining);if(t===""&&this.peekStartsWith(";"))throw new Oe(4009,!1);return this.capture(t),new Di($r(t),this.parseMatrixParams())}parseMatrixParams(){let t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){let e=dp(this.remaining);if(!e)return;this.capture(e);let i="";if(this.consumeOptional("=")){let n=ka(this.remaining);n&&(i=n,this.capture(i))}t[$r(e)]=$r(i)}parseQueryParam(t){let e=hp(this.remaining);if(!e)return;this.capture(e);let i="";if(this.consumeOptional("=")){let a=mp(this.remaining);a&&(i=a,this.capture(i))}let n=Gc(e),s=Gc(i);if(t.hasOwnProperty(n)){let a=t[n];Array.isArray(a)||(a=[a],t[n]=a),a.push(s)}else t[n]=s}parseParens(t){let e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let i=ka(this.remaining),n=this.remaining[i.length];if(n!=="/"&&n!==")"&&n!==";")throw new Oe(4010,!1);let s;i.indexOf(":")>-1?(s=i.slice(0,i.indexOf(":")),this.capture(s),this.capture(":")):t&&(s=q);let a=this.parseChildren();e[s]=Object.keys(a).length===1?a[q]:new re([],a),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return this.peekStartsWith(t)?(this.remaining=this.remaining.substring(t.length),!0):!1}capture(t){if(!this.consumeOptional(t))throw new Oe(4011,!1)}};function dd(r){return r.segments.length>0?new re([],{[q]:r}):r}function ud(r){let t={};for(let[i,n]of Object.entries(r.children)){let s=ud(n);if(i===q&&s.segments.length===0&&s.hasChildren())for(let[a,o]of Object.entries(s.children))t[a]=o;else(s.segments.length>0||s.hasChildren())&&(t[i]=s)}let e=new re(r.segments,t);return fp(e)}function fp(r){if(r.numberOfChildren===1&&r.children[q]){let t=r.children[q];return new re(r.segments.concat(t.segments),t.children)}return r}function ki(r){return r instanceof ei}function gp(r,t,e=null,i=null){let n=hd(r);return pd(n,t,e,i)}function hd(r){let t;function e(s){let a={};for(let l of s.children){let c=e(l);a[l.outlet]=c}let o=new re(s.url,a);return s===r&&(t=o),o}let i=e(r.root),n=dd(i);return t??n}function pd(r,t,e,i){let n=r;for(;n.parent;)n=n.parent;if(t.length===0)return Pa(n,n,n,e,i);let s=_p(t);if(s.toRoot())return Pa(n,n,new re([],{}),e,i);let a=Cp(s,n,r),o=a.processChildren?Un(a.segmentGroup,a.index,s.commands):fd(a.segmentGroup,a.index,s.commands);return Pa(n,a.segmentGroup,o,e,i)}function Ur(r){return typeof r=="object"&&r!=null&&!r.outlets&&!r.segmentPath}function jn(r){return typeof r=="object"&&r!=null&&r.outlets}function Pa(r,t,e,i,n){let s={};i&&Object.entries(i).forEach(([l,c])=>{s[l]=Array.isArray(c)?c.map(d=>`${d}`):`${c}`});let a;r===t?a=e:a=md(r,t,e);let o=dd(ud(a));return new ei(o,s,n)}function md(r,t,e){let i={};return Object.entries(r.children).forEach(([n,s])=>{s===t?i[n]=e:i[n]=md(s,t,e)}),new re(r.segments,i)}var Br=class{constructor(t,e,i){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=i,t&&i.length>0&&Ur(i[0]))throw new Oe(4003,!1);let n=i.find(jn);if(n&&n!==nd(i))throw new Oe(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function _p(r){if(typeof r[0]=="string"&&r.length===1&&r[0]==="/")return new Br(!0,0,r);let t=0,e=!1,i=r.reduce((n,s,a)=>{if(typeof s=="object"&&s!=null){if(s.outlets){let o={};return Object.entries(s.outlets).forEach(([l,c])=>{o[l]=typeof c=="string"?c.split("/"):c}),[...n,{outlets:o}]}if(s.segmentPath)return[...n,s.segmentPath]}return typeof s!="string"?[...n,s]:a===0?(s.split("/").forEach((o,l)=>{l==0&&o==="."||(l==0&&o===""?e=!0:o===".."?t++:o!=""&&n.push(o))}),n):[...n,s]},[]);return new Br(e,t,i)}var an=class{constructor(t,e,i){this.segmentGroup=t,this.processChildren=e,this.index=i}};function Cp(r,t,e){if(r.isAbsolute)return new an(t,!0,0);if(!e)return new an(t,!1,NaN);if(e.parent===null)return new an(e,!0,0);let i=Ur(r.commands[0])?0:1,n=e.segments.length-1+i;return vp(e,n,r.numberOfDoubleDots)}function vp(r,t,e){let i=r,n=t,s=e;for(;s>n;){if(s-=n,i=i.parent,!i)throw new Oe(4005,!1);n=i.segments.length}return new an(i,!1,n-s)}function bp(r){return jn(r[0])?r[0].outlets:{[q]:r}}function fd(r,t,e){if(r??=new re([],{}),r.segments.length===0&&r.hasChildren())return Un(r,t,e);let i=yp(r,t,e),n=e.slice(i.commandIndex);if(i.match&&i.pathIndexs!==q)&&r.children[q]&&r.numberOfChildren===1&&r.children[q].segments.length===0){let s=Un(r.children[q],t,e);return new re(r.segments,s.children)}return Object.entries(i).forEach(([s,a])=>{typeof a=="string"&&(a=[a]),a!==null&&(n[s]=fd(r.children[s],t,a))}),Object.entries(r.children).forEach(([s,a])=>{i[s]===void 0&&(n[s]=a)}),new re(r.segments,n)}}function yp(r,t,e){let i=0,n=t,s={match:!1,pathIndex:0,commandIndex:0};for(;n=e.length)return s;let a=r.segments[n],o=e[i];if(jn(o))break;let l=`${o}`,c=i0&&l===void 0)break;if(l&&c&&typeof c=="object"&&c.outlets===void 0){if(!qc(l,c,a))return s;i+=2}else{if(!qc(l,{},a))return s;i++}n++}return{match:!0,pathIndex:n,commandIndex:i}}function Ua(r,t,e){let i=r.segments.slice(0,t),n=0;for(;n{typeof i=="string"&&(i=[i]),i!==null&&(t[e]=Ua(new re([],{}),0,i))}),t}function Kc(r){let t={};return Object.entries(r).forEach(([e,i])=>t[e]=`${i}`),t}function qc(r,t,e){return r==e.path&&Gt(t,e.parameters)}var Bn="imperative",Le=function(r){return r[r.NavigationStart=0]="NavigationStart",r[r.NavigationEnd=1]="NavigationEnd",r[r.NavigationCancel=2]="NavigationCancel",r[r.NavigationError=3]="NavigationError",r[r.RoutesRecognized=4]="RoutesRecognized",r[r.ResolveStart=5]="ResolveStart",r[r.ResolveEnd=6]="ResolveEnd",r[r.GuardsCheckStart=7]="GuardsCheckStart",r[r.GuardsCheckEnd=8]="GuardsCheckEnd",r[r.RouteConfigLoadStart=9]="RouteConfigLoadStart",r[r.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",r[r.ChildActivationStart=11]="ChildActivationStart",r[r.ChildActivationEnd=12]="ChildActivationEnd",r[r.ActivationStart=13]="ActivationStart",r[r.ActivationEnd=14]="ActivationEnd",r[r.Scroll=15]="Scroll",r[r.NavigationSkipped=16]="NavigationSkipped",r}(Le||{}),gt=class{constructor(t,e){this.id=t,this.url=e}},un=class extends gt{constructor(t,e,i="imperative",n=null){super(t,e),this.type=Le.NavigationStart,this.navigationTrigger=i,this.restoredState=n}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},kt=class extends gt{constructor(t,e,i){super(t,e),this.urlAfterRedirects=i,this.type=Le.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},ct=function(r){return r[r.Redirect=0]="Redirect",r[r.SupersededByNewNavigation=1]="SupersededByNewNavigation",r[r.NoDataFromResolver=2]="NoDataFromResolver",r[r.GuardRejected=3]="GuardRejected",r}(ct||{}),Hr=function(r){return r[r.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",r[r.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",r}(Hr||{}),Jt=class extends gt{constructor(t,e,i,n){super(t,e),this.reason=i,this.code=n,this.type=Le.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},di=class extends gt{constructor(t,e,i,n){super(t,e),this.reason=i,this.code=n,this.type=Le.NavigationSkipped}},zn=class extends gt{constructor(t,e,i,n){super(t,e),this.error=i,this.target=n,this.type=Le.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},jr=class extends gt{constructor(t,e,i,n){super(t,e),this.urlAfterRedirects=i,this.state=n,this.type=Le.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Ba=class extends gt{constructor(t,e,i,n){super(t,e),this.urlAfterRedirects=i,this.state=n,this.type=Le.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Ha=class extends gt{constructor(t,e,i,n,s){super(t,e),this.urlAfterRedirects=i,this.state=n,this.shouldActivate=s,this.type=Le.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},ja=class extends gt{constructor(t,e,i,n){super(t,e),this.urlAfterRedirects=i,this.state=n,this.type=Le.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},za=class extends gt{constructor(t,e,i,n){super(t,e),this.urlAfterRedirects=i,this.state=n,this.type=Le.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Wa=class{constructor(t){this.route=t,this.type=Le.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},Ga=class{constructor(t){this.route=t,this.type=Le.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},Ka=class{constructor(t){this.snapshot=t,this.type=Le.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},qa=class{constructor(t){this.snapshot=t,this.type=Le.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Za=class{constructor(t){this.snapshot=t,this.type=Le.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Xa=class{constructor(t){this.snapshot=t,this.type=Le.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},zr=class{constructor(t,e,i){this.routerEvent=t,this.position=e,this.anchor=i,this.type=Le.Scroll}toString(){let t=this.position?`${this.position[0]}, ${this.position[1]}`:null;return`Scroll(anchor: '${this.anchor}', position: '${t}')`}},Wn=class{},hn=class{constructor(t,e){this.url=t,this.navigationBehaviorOptions=e}};function Ip(r,t){return r.providers&&!r._injector&&(r._injector=ga(r.providers,t,`Route: ${r.path}`)),r._injector??t}function Lt(r){return r.outlet||q}function Tp(r,t){let e=r.filter(i=>Lt(i)===t);return e.push(...r.filter(i=>Lt(i)!==t)),e}function Jn(r){if(!r)return null;if(r.routeConfig?._injector)return r.routeConfig._injector;for(let t=r.parent;t;t=t.parent){let e=t.routeConfig;if(e?._loadedInjector)return e._loadedInjector;if(e?._injector)return e._injector}return null}var Ya=class{get injector(){return Jn(this.route?.snapshot)??this.rootInjector}set injector(t){}constructor(t){this.rootInjector=t,this.outlet=null,this.route=null,this.children=new er(this.rootInjector),this.attachRef=null}},er=(()=>{class r{constructor(e){this.rootInjector=e,this.contexts=new Map}onChildOutletCreated(e,i){let n=this.getOrCreateContext(e);n.outlet=i,this.contexts.set(e,n)}onChildOutletDestroyed(e){let i=this.getContext(e);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){let e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let i=this.getContext(e);return i||(i=new Ya(this.rootInjector),this.contexts.set(e,i)),i}getContext(e){return this.contexts.get(e)||null}static{this.\u0275fac=function(i){return new(i||r)(D(Ti))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),Wr=class{constructor(t){this._root=t}get root(){return this._root.value}parent(t){let e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){let e=Qa(t,this._root);return e?e.children.map(i=>i.value):[]}firstChild(t){let e=Qa(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){let e=Ja(t,this._root);return e.length<2?[]:e[e.length-2].children.map(n=>n.value).filter(n=>n!==t)}pathFromRoot(t){return Ja(t,this._root).map(e=>e.value)}};function Qa(r,t){if(r===t.value)return t;for(let e of t.children){let i=Qa(r,e);if(i)return i}return null}function Ja(r,t){if(r===t.value)return[t];for(let e of t.children){let i=Ja(r,e);if(i.length)return i.unshift(t),i}return[]}var lt=class{constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}};function sn(r){let t={};return r&&r.children.forEach(e=>t[e.value.outlet]=e),t}var Gr=class extends Wr{constructor(t,e){super(t),this.snapshot=e,lo(this,t)}toString(){return this.snapshot.toString()}};function gd(r){let t=wp(r),e=new te([new Di("",{})]),i=new te({}),n=new te({}),s=new te({}),a=new te(""),o=new _t(e,i,s,a,n,q,r,t.root);return o.snapshot=t.root,new Gr(new lt(o,[]),t)}function wp(r){let t={},e={},i={},n="",s=new on([],t,i,n,e,q,r,null,{});return new qr("",new lt(s,[]))}var _t=class{constructor(t,e,i,n,s,a,o,l){this.urlSubject=t,this.paramsSubject=e,this.queryParamsSubject=i,this.fragmentSubject=n,this.dataSubject=s,this.outlet=a,this.component=o,this._futureSnapshot=l,this.title=this.dataSubject?.pipe(R(c=>c[Yn]))??C(void 0),this.url=t,this.params=e,this.queryParams=i,this.fragment=n,this.data=s}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(R(t=>cn(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(R(t=>cn(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function Kr(r,t,e="emptyOnly"){let i,{routeConfig:n}=r;return t!==null&&(e==="always"||n?.path===""||!t.component&&!t.routeConfig?.loadComponent)?i={params:f(f({},t.params),r.params),data:f(f({},t.data),r.data),resolve:f(f(f(f({},r.data),t.data),n?.data),r._resolvedData)}:i={params:f({},r.params),data:f({},r.data),resolve:f(f({},r.data),r._resolvedData??{})},n&&Cd(n)&&(i.resolve[Yn]=n.title),i}var on=class{get title(){return this.data?.[Yn]}constructor(t,e,i,n,s,a,o,l,c){this.url=t,this.params=e,this.queryParams=i,this.fragment=n,this.data=s,this.outlet=a,this.component=o,this.routeConfig=l,this._resolve=c}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=cn(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=cn(this.queryParams),this._queryParamMap}toString(){let t=this.url.map(i=>i.toString()).join("/"),e=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${t}', path:'${e}')`}},qr=class extends Wr{constructor(t,e){super(e),this.url=t,lo(this,e)}toString(){return _d(this._root)}};function lo(r,t){t.value._routerState=r,t.children.forEach(e=>lo(r,e))}function _d(r){let t=r.children.length>0?` { ${r.children.map(_d).join(", ")} } `:"";return`${r.value}${t}`}function Oa(r){if(r.snapshot){let t=r.snapshot,e=r._futureSnapshot;r.snapshot=e,Gt(t.queryParams,e.queryParams)||r.queryParamsSubject.next(e.queryParams),t.fragment!==e.fragment&&r.fragmentSubject.next(e.fragment),Gt(t.params,e.params)||r.paramsSubject.next(e.params),Qh(t.url,e.url)||r.urlSubject.next(e.url),Gt(t.data,e.data)||r.dataSubject.next(e.data)}else r.snapshot=r._futureSnapshot,r.dataSubject.next(r._futureSnapshot.data)}function eo(r,t){let e=Gt(r.params,t.params)&&ip(r.url,t.url),i=!r.parent!=!t.parent;return e&&!i&&(!r.parent||eo(r.parent,t.parent))}function Cd(r){return typeof r.title=="string"||r.title===null}var co=(()=>{class r{constructor(){this.activated=null,this._activatedRoute=null,this.name=q,this.activateEvents=new W,this.deactivateEvents=new W,this.attachEvents=new W,this.detachEvents=new W,this.parentContexts=b(er),this.location=b(wi),this.changeDetector=b(Ne),this.inputBinder=b(Jr,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(e){if(e.name){let{firstChange:i,previousValue:n}=e.name;if(i)return;this.isTrackedInParentContexts(n)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(n)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(e){return this.parentContexts.getContext(e)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let e=this.parentContexts.getContext(this.name);e?.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Oe(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Oe(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Oe(4012,!1);this.location.detach();let e=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(e.instance),e}attach(e,i){this.activated=e,this._activatedRoute=i,this.location.insert(e.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(e.instance)}deactivate(){if(this.activated){let e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,i){if(this.isActivated)throw new Oe(4013,!1);this._activatedRoute=e;let n=this.location,a=e.snapshot.component,o=this.parentContexts.getOrCreateContext(this.name).children,l=new to(e,o,n.injector);this.activated=n.createComponent(a,{index:n.length,injector:l,environmentInjector:i}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275dir=Se({type:r,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[nt]})}}return r})(),to=class r{__ngOutletInjector(t){return new r(this.route,this.childContexts,t)}constructor(t,e,i){this.route=t,this.childContexts=e,this.parent=i}get(t,e){return t===_t?this.route:t===er?this.childContexts:this.parent.get(t,e)}},Jr=new ae(""),Zc=(()=>{class r{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(e){this.unsubscribeFromRouteData(e),this.subscribeToRouteData(e)}unsubscribeFromRouteData(e){this.outletDataSubscriptions.get(e)?.unsubscribe(),this.outletDataSubscriptions.delete(e)}subscribeToRouteData(e){let{activatedRoute:i}=e,n=$t([i.queryParams,i.params,i.data]).pipe(ee(([s,a,o],l)=>(o=f(f(f({},s),a),o),l===0?C(o):Promise.resolve(o)))).subscribe(s=>{if(!e.isActivated||!e.activatedComponentRef||e.activatedRoute!==i||i.component===null){this.unsubscribeFromRouteData(e);return}let a=Xl(i.component);if(!a){this.unsubscribeFromRouteData(e);return}for(let{templateName:o}of a.inputs)e.activatedComponentRef.setInput(o,s[o])});this.outletDataSubscriptions.set(e,n)}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac})}}return r})();function Ep(r,t,e){let i=Gn(r,t._root,e?e._root:void 0);return new Gr(i,t)}function Gn(r,t,e){if(e&&r.shouldReuseRoute(t.value,e.value.snapshot)){let i=e.value;i._futureSnapshot=t.value;let n=Ap(r,t,e);return new lt(i,n)}else{if(r.shouldAttach(t.value)){let s=r.retrieve(t.value);if(s!==null){let a=s.route;return a.value._futureSnapshot=t.value,a.children=t.children.map(o=>Gn(r,o)),a}}let i=Rp(t.value),n=t.children.map(s=>Gn(r,s));return new lt(i,n)}}function Ap(r,t,e){return t.children.map(i=>{for(let n of e.children)if(r.shouldReuseRoute(i.value,n.value.snapshot))return Gn(r,i,n);return Gn(r,i)})}function Rp(r){return new _t(new te(r.url),new te(r.params),new te(r.queryParams),new te(r.fragment),new te(r.data),r.outlet,r.component,r)}var Kn=class{constructor(t,e){this.redirectTo=t,this.navigationBehaviorOptions=e}},vd="ngNavigationCancelingError";function Zr(r,t){let{redirectTo:e,navigationBehaviorOptions:i}=ki(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,n=bd(!1,ct.Redirect);return n.url=e,n.navigationBehaviorOptions=i,n}function bd(r,t){let e=new Error(`NavigationCancelingError: ${r||""}`);return e[vd]=!0,e.cancellationCode=t,e}function xp(r){return yd(r)&&ki(r.url)}function yd(r){return!!r&&r[vd]}var Dp=(r,t,e,i)=>R(n=>(new io(t,n.targetRouterState,n.currentRouterState,e,i).activate(r),n)),io=class{constructor(t,e,i,n,s){this.routeReuseStrategy=t,this.futureState=e,this.currState=i,this.forwardEvent=n,this.inputBindingEnabled=s}activate(t){let e=this.futureState._root,i=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,i,t),Oa(this.futureState.root),this.activateChildRoutes(e,i,t)}deactivateChildRoutes(t,e,i){let n=sn(e);t.children.forEach(s=>{let a=s.value.outlet;this.deactivateRoutes(s,n[a],i),delete n[a]}),Object.values(n).forEach(s=>{this.deactivateRouteAndItsChildren(s,i)})}deactivateRoutes(t,e,i){let n=t.value,s=e?e.value:null;if(n===s)if(n.component){let a=i.getContext(n.outlet);a&&this.deactivateChildRoutes(t,e,a.children)}else this.deactivateChildRoutes(t,e,i);else s&&this.deactivateRouteAndItsChildren(e,i)}deactivateRouteAndItsChildren(t,e){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){let i=e.getContext(t.value.outlet),n=i&&t.value.component?i.children:e,s=sn(t);for(let a of Object.values(s))this.deactivateRouteAndItsChildren(a,n);if(i&&i.outlet){let a=i.outlet.detach(),o=i.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:a,route:t,contexts:o})}}deactivateRouteAndOutlet(t,e){let i=e.getContext(t.value.outlet),n=i&&t.value.component?i.children:e,s=sn(t);for(let a of Object.values(s))this.deactivateRouteAndItsChildren(a,n);i&&(i.outlet&&(i.outlet.deactivate(),i.children.onOutletDeactivated()),i.attachRef=null,i.route=null)}activateChildRoutes(t,e,i){let n=sn(e);t.children.forEach(s=>{this.activateRoutes(s,n[s.value.outlet],i),this.forwardEvent(new Xa(s.value.snapshot))}),t.children.length&&this.forwardEvent(new qa(t.value.snapshot))}activateRoutes(t,e,i){let n=t.value,s=e?e.value:null;if(Oa(n),n===s)if(n.component){let a=i.getOrCreateContext(n.outlet);this.activateChildRoutes(t,e,a.children)}else this.activateChildRoutes(t,e,i);else if(n.component){let a=i.getOrCreateContext(n.outlet);if(this.routeReuseStrategy.shouldAttach(n.snapshot)){let o=this.routeReuseStrategy.retrieve(n.snapshot);this.routeReuseStrategy.store(n.snapshot,null),a.children.onOutletReAttached(o.contexts),a.attachRef=o.componentRef,a.route=o.route.value,a.outlet&&a.outlet.attach(o.componentRef,o.route.value),Oa(o.route.value),this.activateChildRoutes(t,null,a.children)}else a.attachRef=null,a.route=n,a.outlet&&a.outlet.activateWith(n,a.injector),this.activateChildRoutes(t,null,a.children)}else this.activateChildRoutes(t,null,i)}},Xr=class{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}},ln=class{constructor(t,e){this.component=t,this.route=e}};function Lp(r,t,e){let i=r._root,n=t?t._root:null;return Vn(i,n,e,[i.value])}function kp(r){let t=r.routeConfig?r.routeConfig.canActivateChild:null;return!t||t.length===0?null:{node:r,guards:t}}function mn(r,t){let e=Symbol(),i=t.get(r,e);return i===e?typeof r=="function"&&!Ll(r)?r:t.get(r):i}function Vn(r,t,e,i,n={canDeactivateChecks:[],canActivateChecks:[]}){let s=sn(t);return r.children.forEach(a=>{Pp(a,s[a.value.outlet],e,i.concat([a.value]),n),delete s[a.value.outlet]}),Object.entries(s).forEach(([a,o])=>Hn(o,e.getContext(a),n)),n}function Pp(r,t,e,i,n={canDeactivateChecks:[],canActivateChecks:[]}){let s=r.value,a=t?t.value:null,o=e?e.getContext(r.value.outlet):null;if(a&&s.routeConfig===a.routeConfig){let l=Op(a,s,s.routeConfig.runGuardsAndResolvers);l?n.canActivateChecks.push(new Xr(i)):(s.data=a.data,s._resolvedData=a._resolvedData),s.component?Vn(r,t,o?o.children:null,i,n):Vn(r,t,e,i,n),l&&o&&o.outlet&&o.outlet.isActivated&&n.canDeactivateChecks.push(new ln(o.outlet.component,a))}else a&&Hn(t,o,n),n.canActivateChecks.push(new Xr(i)),s.component?Vn(r,null,o?o.children:null,i,n):Vn(r,null,e,i,n);return n}function Op(r,t,e){if(typeof e=="function")return e(r,t);switch(e){case"pathParamsChange":return!Li(r.url,t.url);case"pathParamsOrQueryParamsChange":return!Li(r.url,t.url)||!Gt(r.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!eo(r,t)||!Gt(r.queryParams,t.queryParams);case"paramsChange":default:return!eo(r,t)}}function Hn(r,t,e){let i=sn(r),n=r.value;Object.entries(i).forEach(([s,a])=>{n.component?t?Hn(a,t.children.getContext(s),e):Hn(a,null,e):Hn(a,t,e)}),n.component?t&&t.outlet&&t.outlet.isActivated?e.canDeactivateChecks.push(new ln(t.outlet.component,n)):e.canDeactivateChecks.push(new ln(null,n)):e.canDeactivateChecks.push(new ln(null,n))}function tr(r){return typeof r=="function"}function Mp(r){return typeof r=="boolean"}function Np(r){return r&&tr(r.canLoad)}function Fp(r){return r&&tr(r.canActivate)}function Vp(r){return r&&tr(r.canActivateChild)}function $p(r){return r&&tr(r.canDeactivate)}function Up(r){return r&&tr(r.canMatch)}function Sd(r){return r instanceof Il||r?.name==="EmptyError"}var Nr=Symbol("INITIAL_VALUE");function pn(){return ee(r=>$t(r.map(t=>t.pipe(ie(1),Ii(Nr)))).pipe(R(t=>{for(let e of t)if(e!==!0){if(e===Nr)return Nr;if(e===!1||Bp(e))return e}return!0}),me(t=>t!==Nr),ie(1)))}function Bp(r){return ki(r)||r instanceof Kn}function Hp(r,t){return ke(e=>{let{targetSnapshot:i,currentSnapshot:n,guards:{canActivateChecks:s,canDeactivateChecks:a}}=e;return a.length===0&&s.length===0?C(j(f({},e),{guardsResult:!0})):jp(a,i,n,r).pipe(ke(o=>o&&Mp(o)?zp(i,s,r,t):C(o)),R(o=>j(f({},e),{guardsResult:o})))})}function jp(r,t,e,i){return $e(r).pipe(ke(n=>Zp(n.component,n.route,e,t,i)),ai(n=>n!==!0,!0))}function zp(r,t,e,i){return $e(t).pipe(si(n=>yi(Gp(n.route.parent,i),Wp(n.route,i),qp(r,n.path,e),Kp(r,n.route,e))),ai(n=>n!==!0,!0))}function Wp(r,t){return r!==null&&t&&t(new Za(r)),C(!0)}function Gp(r,t){return r!==null&&t&&t(new Ka(r)),C(!0)}function Kp(r,t,e){let i=t.routeConfig?t.routeConfig.canActivate:null;if(!i||i.length===0)return C(!0);let n=i.map(s=>ji(()=>{let a=Jn(t)??e,o=mn(s,a),l=Fp(o)?o.canActivate(t,r):Ut(a,()=>o(t,r));return ui(l).pipe(ai())}));return C(n).pipe(pn())}function qp(r,t,e){let i=t[t.length-1],s=t.slice(0,t.length-1).reverse().map(a=>kp(a)).filter(a=>a!==null).map(a=>ji(()=>{let o=a.guards.map(l=>{let c=Jn(a.node)??e,d=mn(l,c),u=Vp(d)?d.canActivateChild(i,r):Ut(c,()=>d(i,r));return ui(u).pipe(ai())});return C(o).pipe(pn())}));return C(s).pipe(pn())}function Zp(r,t,e,i,n){let s=t&&t.routeConfig?t.routeConfig.canDeactivate:null;if(!s||s.length===0)return C(!0);let a=s.map(o=>{let l=Jn(t)??n,c=mn(o,l),d=$p(c)?c.canDeactivate(r,t,e,i):Ut(l,()=>c(r,t,e,i));return ui(d).pipe(ai())});return C(a).pipe(pn())}function Xp(r,t,e,i){let n=t.canLoad;if(n===void 0||n.length===0)return C(!0);let s=n.map(a=>{let o=mn(a,r),l=Np(o)?o.canLoad(t,e):Ut(r,()=>o(t,e));return ui(l)});return C(s).pipe(pn(),Id(i))}function Id(r){return Sl(H(t=>{if(typeof t!="boolean")throw Zr(r,t)}),R(t=>t===!0))}function Yp(r,t,e,i){let n=t.canMatch;if(!n||n.length===0)return C(!0);let s=n.map(a=>{let o=mn(a,r),l=Up(o)?o.canMatch(t,e):Ut(r,()=>o(t,e));return ui(l)});return C(s).pipe(pn(),Id(i))}var qn=class{constructor(t){this.segmentGroup=t||null}},Zn=class extends Error{constructor(t){super(),this.urlTree=t}};function rn(r){return bi(new qn(r))}function Qp(r){return bi(new Oe(4e3,!1))}function Jp(r){return bi(bd(!1,ct.GuardRejected))}var no=class{constructor(t,e){this.urlSerializer=t,this.urlTree=e}lineralizeSegments(t,e){let i=[],n=e.root;for(;;){if(i=i.concat(n.segments),n.numberOfChildren===0)return C(i);if(n.numberOfChildren>1||!n.children[q])return Qp(`${t.redirectTo}`);n=n.children[q]}}applyRedirectCommands(t,e,i,n,s){if(typeof e!="string"){let o=e,{queryParams:l,fragment:c,routeConfig:d,url:u,outlet:h,params:p,data:m,title:A}=n,_=Ut(s,()=>o({params:p,data:m,queryParams:l,fragment:c,routeConfig:d,url:u,outlet:h,title:A}));if(_ instanceof ei)throw new Zn(_);e=_}let a=this.applyRedirectCreateUrlTree(e,this.urlSerializer.parse(e),t,i);if(e[0]==="/")throw new Zn(a);return a}applyRedirectCreateUrlTree(t,e,i,n){let s=this.createSegmentGroup(t,e.root,i,n);return new ei(s,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){let i={};return Object.entries(t).forEach(([n,s])=>{if(typeof s=="string"&&s[0]===":"){let o=s.substring(1);i[n]=e[o]}else i[n]=s}),i}createSegmentGroup(t,e,i,n){let s=this.createSegments(t,e.segments,i,n),a={};return Object.entries(e.children).forEach(([o,l])=>{a[o]=this.createSegmentGroup(t,l,i,n)}),new re(s,a)}createSegments(t,e,i,n){return e.map(s=>s.path[0]===":"?this.findPosParam(t,s,n):this.findOrReturn(s,i))}findPosParam(t,e,i){let n=i[e.path.substring(1)];if(!n)throw new Oe(4001,!1);return n}findOrReturn(t,e){let i=0;for(let n of e){if(n.path===t.path)return e.splice(i),n;i++}return t}},ro={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function em(r,t,e,i,n){let s=Td(r,t,e);return s.matched?(i=Ip(t,i),Yp(i,t,e,n).pipe(R(a=>a===!0?s:f({},ro)))):C(s)}function Td(r,t,e){if(t.path==="**")return tm(e);if(t.path==="")return t.pathMatch==="full"&&(r.hasChildren()||e.length>0)?f({},ro):{matched:!0,consumedSegments:[],remainingSegments:e,parameters:{},positionalParamSegments:{}};let n=(t.matcher||Yh)(e,r,t);if(!n)return f({},ro);let s={};Object.entries(n.posParams??{}).forEach(([o,l])=>{s[o]=l.path});let a=n.consumed.length>0?f(f({},s),n.consumed[n.consumed.length-1].parameters):s;return{matched:!0,consumedSegments:n.consumed,remainingSegments:e.slice(n.consumed.length),parameters:a,positionalParamSegments:n.posParams??{}}}function tm(r){return{matched:!0,parameters:r.length>0?nd(r).parameters:{},consumedSegments:r,remainingSegments:[],positionalParamSegments:{}}}function Xc(r,t,e,i){return e.length>0&&rm(r,e,i)?{segmentGroup:new re(t,nm(i,new re(e,r.children))),slicedSegments:[]}:e.length===0&&sm(r,e,i)?{segmentGroup:new re(r.segments,im(r,e,i,r.children)),slicedSegments:e}:{segmentGroup:new re(r.segments,r.children),slicedSegments:e}}function im(r,t,e,i){let n={};for(let s of e)if(es(r,t,s)&&!i[Lt(s)]){let a=new re([],{});n[Lt(s)]=a}return f(f({},i),n)}function nm(r,t){let e={};e[q]=t;for(let i of r)if(i.path===""&&Lt(i)!==q){let n=new re([],{});e[Lt(i)]=n}return e}function rm(r,t,e){return e.some(i=>es(r,t,i)&&Lt(i)!==q)}function sm(r,t,e){return e.some(i=>es(r,t,i))}function es(r,t,e){return(r.hasChildren()||t.length>0)&&e.pathMatch==="full"?!1:e.path===""}function am(r,t,e){return t.length===0&&!r.children[e]}var so=class{};function om(r,t,e,i,n,s,a="emptyOnly"){return new ao(r,t,e,i,n,a,s).recognize()}var lm=31,ao=class{constructor(t,e,i,n,s,a,o){this.injector=t,this.configLoader=e,this.rootComponentType=i,this.config=n,this.urlTree=s,this.paramsInheritanceStrategy=a,this.urlSerializer=o,this.applyRedirects=new no(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new Oe(4002,`'${t.segmentGroup}'`)}recognize(){let t=Xc(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(R(({children:e,rootSnapshot:i})=>{let n=new lt(i,e),s=new qr("",n),a=gp(i,[],this.urlTree.queryParams,this.urlTree.fragment);return a.queryParams=this.urlTree.queryParams,s.url=this.urlSerializer.serialize(a),{state:s,tree:a}}))}match(t){let e=new on([],Object.freeze({}),Object.freeze(f({},this.urlTree.queryParams)),this.urlTree.fragment,Object.freeze({}),q,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,t,q,e).pipe(R(i=>({children:i,rootSnapshot:e})),ge(i=>{if(i instanceof Zn)return this.urlTree=i.urlTree,this.match(i.urlTree.root);throw i instanceof qn?this.noMatchError(i):i}))}processSegmentGroup(t,e,i,n,s){return i.segments.length===0&&i.hasChildren()?this.processChildren(t,e,i,s):this.processSegment(t,e,i,i.segments,n,!0,s).pipe(R(a=>a instanceof lt?[a]:[]))}processChildren(t,e,i,n){let s=[];for(let a of Object.keys(i.children))a==="primary"?s.unshift(a):s.push(a);return $e(s).pipe(si(a=>{let o=i.children[a],l=Tp(e,a);return this.processSegmentGroup(t,l,o,a,n)}),kn((a,o)=>(a.push(...o),a)),da(null),Ln(),ke(a=>{if(a===null)return rn(i);let o=wd(a);return cm(o),C(o)}))}processSegment(t,e,i,n,s,a,o){return $e(e).pipe(si(l=>this.processSegmentAgainstRoute(l._injector??t,e,l,i,n,s,a,o).pipe(ge(c=>{if(c instanceof qn)return C(null);throw c}))),ai(l=>!!l),ge(l=>{if(Sd(l))return am(i,n,s)?C(new so):rn(i);throw l}))}processSegmentAgainstRoute(t,e,i,n,s,a,o,l){return Lt(i)!==a&&(a===q||!es(n,s,i))?rn(n):i.redirectTo===void 0?this.matchSegmentAgainstRoute(t,n,i,s,a,l):this.allowRedirects&&o?this.expandSegmentAgainstRouteUsingRedirect(t,n,e,i,s,a,l):rn(n)}expandSegmentAgainstRouteUsingRedirect(t,e,i,n,s,a,o){let{matched:l,parameters:c,consumedSegments:d,positionalParamSegments:u,remainingSegments:h}=Td(e,n,s);if(!l)return rn(e);typeof n.redirectTo=="string"&&n.redirectTo[0]==="/"&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>lm&&(this.allowRedirects=!1));let p=new on(s,c,Object.freeze(f({},this.urlTree.queryParams)),this.urlTree.fragment,Yc(n),Lt(n),n.component??n._loadedComponent??null,n,Qc(n)),m=Kr(p,o,this.paramsInheritanceStrategy);p.params=Object.freeze(m.params),p.data=Object.freeze(m.data);let A=this.applyRedirects.applyRedirectCommands(d,n.redirectTo,u,p,t);return this.applyRedirects.lineralizeSegments(n,A).pipe(ke(_=>this.processSegment(t,i,e,_.concat(h),a,!1,o)))}matchSegmentAgainstRoute(t,e,i,n,s,a){let o=em(e,i,n,t,this.urlSerializer);return i.path==="**"&&(e.children={}),o.pipe(ee(l=>l.matched?(t=i._injector??t,this.getChildConfig(t,i,n).pipe(ee(({routes:c})=>{let d=i._loadedInjector??t,{parameters:u,consumedSegments:h,remainingSegments:p}=l,m=new on(h,u,Object.freeze(f({},this.urlTree.queryParams)),this.urlTree.fragment,Yc(i),Lt(i),i.component??i._loadedComponent??null,i,Qc(i)),A=Kr(m,a,this.paramsInheritanceStrategy);m.params=Object.freeze(A.params),m.data=Object.freeze(A.data);let{segmentGroup:_,slicedSegments:x}=Xc(e,h,p,c);if(x.length===0&&_.hasChildren())return this.processChildren(d,c,_,m).pipe(R(U=>new lt(m,U)));if(c.length===0&&x.length===0)return C(new lt(m,[]));let k=Lt(i)===s;return this.processSegment(d,c,_,x,k?q:s,!0,m).pipe(R(U=>new lt(m,U instanceof lt?[U]:[])))}))):rn(e)))}getChildConfig(t,e,i){return e.children?C({routes:e.children,injector:t}):e.loadChildren?e._loadedRoutes!==void 0?C({routes:e._loadedRoutes,injector:e._loadedInjector}):Xp(t,e,i,this.urlSerializer).pipe(ke(n=>n?this.configLoader.loadChildren(t,e).pipe(H(s=>{e._loadedRoutes=s.routes,e._loadedInjector=s.injector})):Jp(e))):C({routes:[],injector:t})}};function cm(r){r.sort((t,e)=>t.value.outlet===q?-1:e.value.outlet===q?1:t.value.outlet.localeCompare(e.value.outlet))}function dm(r){let t=r.value.routeConfig;return t&&t.path===""}function wd(r){let t=[],e=new Set;for(let i of r){if(!dm(i)){t.push(i);continue}let n=t.find(s=>i.value.routeConfig===s.value.routeConfig);n!==void 0?(n.children.push(...i.children),e.add(n)):t.push(i)}for(let i of e){let n=wd(i.children);t.push(new lt(i.value,n))}return t.filter(i=>!e.has(i))}function Yc(r){return r.data||{}}function Qc(r){return r.resolve||{}}function um(r,t,e,i,n,s){return ke(a=>om(r,t,e,i,a.extractedUrl,n,s).pipe(R(({state:o,tree:l})=>j(f({},a),{targetSnapshot:o,urlAfterRedirects:l}))))}function hm(r,t){return ke(e=>{let{targetSnapshot:i,guards:{canActivateChecks:n}}=e;if(!n.length)return C(e);let s=new Set(n.map(l=>l.route)),a=new Set;for(let l of s)if(!a.has(l))for(let c of Ed(l))a.add(c);let o=0;return $e(a).pipe(si(l=>s.has(l)?pm(l,i,r,t):(l.data=Kr(l,l.parent,r).resolve,C(void 0))),H(()=>o++),ha(1),ke(l=>o===a.size?C(e):dt))})}function Ed(r){let t=r.children.map(e=>Ed(e)).flat();return[r,...t]}function pm(r,t,e,i){let n=r.routeConfig,s=r._resolve;return n?.title!==void 0&&!Cd(n)&&(s[Yn]=n.title),mm(s,r,t,i).pipe(R(a=>(r._resolvedData=a,r.data=Kr(r,r.parent,e).resolve,null)))}function mm(r,t,e,i){let n=Fa(r);if(n.length===0)return C({});let s={};return $e(n).pipe(ke(a=>fm(r[a],t,e,i).pipe(ai(),H(o=>{if(o instanceof Kn)throw Zr(new dn,o);s[a]=o}))),ha(1),Al(s),ge(a=>Sd(a)?dt:bi(a)))}function fm(r,t,e,i){let n=Jn(t)??i,s=mn(r,n),a=s.resolve?s.resolve(t,e):Ut(n,()=>s(t,e));return ui(a)}function Ma(r){return ee(t=>{let e=r(t);return e?$e(e).pipe(R(()=>t)):C(t)})}var Ad=(()=>{class r{buildTitle(e){let i,n=e.root;for(;n!==void 0;)i=this.getResolvedTitleForRoute(n)??i,n=n.children.find(s=>s.outlet===q);return i}getResolvedTitleForRoute(e){return e.data[Yn]}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:()=>b(gm),providedIn:"root"})}}return r})(),gm=(()=>{class r extends Ad{constructor(e){super(),this.title=e}updateTitle(e){let i=this.buildTitle(e);i!==void 0&&this.title.setTitle(i)}static{this.\u0275fac=function(i){return new(i||r)(D(Lr))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),ir=new ae("",{providedIn:"root",factory:()=>({})}),_m=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275cmp=Q({type:r,selectors:[["ng-component"]],standalone:!0,features:[ue],decls:1,vars:0,template:function(i,n){i&1&&X(0,"router-outlet")},dependencies:[co],encapsulation:2})}}return r})();function uo(r){let t=r.children&&r.children.map(uo),e=t?j(f({},r),{children:t}):f({},r);return!e.component&&!e.loadComponent&&(t||e.loadChildren)&&e.outlet&&e.outlet!==q&&(e.component=_m),e}var Xn=new ae(""),ho=(()=>{class r{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=b(xr)}loadComponent(e){if(this.componentLoaders.get(e))return this.componentLoaders.get(e);if(e._loadedComponent)return C(e._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(e);let i=ui(e.loadComponent()).pipe(R(Rd),H(s=>{this.onLoadEndListener&&this.onLoadEndListener(e),e._loadedComponent=s}),br(()=>{this.componentLoaders.delete(e)})),n=new oa(i,()=>new B).pipe(aa());return this.componentLoaders.set(e,n),n}loadChildren(e,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return C({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);let s=Cm(i,this.compiler,e,this.onLoadEndListener).pipe(br(()=>{this.childrenLoaders.delete(i)})),a=new oa(s,()=>new B).pipe(aa());return this.childrenLoaders.set(i,a),a}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function Cm(r,t,e,i){return ui(r.loadChildren()).pipe(R(Rd),ke(n=>n instanceof jl||Array.isArray(n)?C(n):$e(t.compileModuleAsync(n))),R(n=>{i&&i(r);let s,a,o=!1;return Array.isArray(n)?(a=n,o=!0):(s=n.create(e).injector,a=s.get(Xn,[],{optional:!0,self:!0}).flat()),{routes:a.map(uo),injector:s}}))}function vm(r){return r&&typeof r=="object"&&"default"in r}function Rd(r){return vm(r)?r.default:r}var po=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:()=>b(bm),providedIn:"root"})}}return r})(),bm=(()=>{class r{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,i){return e}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),xd=new ae(""),Dd=new ae("");function ym(r,t,e){let i=r.get(Dd),n=r.get(fe);return r.get(Re).runOutsideAngular(()=>{if(!n.startViewTransition||i.skipNextTransition)return i.skipNextTransition=!1,new Promise(c=>setTimeout(c));let s,a=new Promise(c=>{s=c}),o=n.startViewTransition(()=>(s(),Sm(r))),{onViewTransitionCreated:l}=i;return l&&Ut(r,()=>l({transition:o,from:t,to:e})),a})}function Sm(r){return new Promise(t=>{li({read:()=>setTimeout(t)},{injector:r})})}var Im=new ae(""),mo=(()=>{class r{get hasRequestedNavigation(){return this.navigationId!==0}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new B,this.transitionAbortSubject=new B,this.configLoader=b(ho),this.environmentInjector=b(Ti),this.urlSerializer=b(Qn),this.rootContexts=b(er),this.location=b(Ai),this.inputBindingEnabled=b(Jr,{optional:!0})!==null,this.titleStrategy=b(Ad),this.options=b(ir,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=b(po),this.createViewTransition=b(xd,{optional:!0}),this.navigationErrorHandler=b(Im,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>C(void 0),this.rootComponentType=null;let e=n=>this.events.next(new Wa(n)),i=n=>this.events.next(new Ga(n));this.configLoader.onLoadEndListener=i,this.configLoader.onLoadStartListener=e}complete(){this.transitions?.complete()}handleNavigationRequest(e){let i=++this.navigationId;this.transitions?.next(j(f(f({},this.transitions.value),e),{id:i}))}setupNavigations(e,i,n){return this.transitions=new te({id:0,currentUrlTree:i,currentRawUrl:i,extractedUrl:this.urlHandlingStrategy.extract(i),urlAfterRedirects:this.urlHandlingStrategy.extract(i),rawUrl:i,extras:{},resolve:()=>{},reject:()=>{},promise:Promise.resolve(!0),source:Bn,restoredState:null,currentSnapshot:n.snapshot,targetSnapshot:null,currentRouterState:n,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(me(s=>s.id!==0),R(s=>j(f({},s),{extractedUrl:this.urlHandlingStrategy.extract(s.rawUrl)})),ee(s=>{let a=!1,o=!1;return C(s).pipe(ee(l=>{if(this.navigationId>s.id)return this.cancelNavigationTransition(s,"",ct.SupersededByNewNavigation),dt;this.currentTransition=s,this.currentNavigation={id:l.id,initialUrl:l.rawUrl,extractedUrl:l.extractedUrl,targetBrowserUrl:typeof l.extras.browserUrl=="string"?this.urlSerializer.parse(l.extras.browserUrl):l.extras.browserUrl,trigger:l.source,extras:l.extras,previousNavigation:this.lastSuccessfulNavigation?j(f({},this.lastSuccessfulNavigation),{previousNavigation:null}):null};let c=!e.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),d=l.extras.onSameUrlNavigation??e.onSameUrlNavigation;if(!c&&d!=="reload"){let u="";return this.events.next(new di(l.id,this.urlSerializer.serialize(l.rawUrl),u,Hr.IgnoredSameUrlNavigation)),l.resolve(!1),dt}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return C(l).pipe(ee(u=>{let h=this.transitions?.getValue();return this.events.next(new un(u.id,this.urlSerializer.serialize(u.extractedUrl),u.source,u.restoredState)),h!==this.transitions?.getValue()?dt:Promise.resolve(u)}),um(this.environmentInjector,this.configLoader,this.rootComponentType,e.config,this.urlSerializer,this.paramsInheritanceStrategy),H(u=>{s.targetSnapshot=u.targetSnapshot,s.urlAfterRedirects=u.urlAfterRedirects,this.currentNavigation=j(f({},this.currentNavigation),{finalUrl:u.urlAfterRedirects});let h=new jr(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(h)}));if(c&&this.urlHandlingStrategy.shouldProcessUrl(l.currentRawUrl)){let{id:u,extractedUrl:h,source:p,restoredState:m,extras:A}=l,_=new un(u,this.urlSerializer.serialize(h),p,m);this.events.next(_);let x=gd(this.rootComponentType).snapshot;return this.currentTransition=s=j(f({},l),{targetSnapshot:x,urlAfterRedirects:h,extras:j(f({},A),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.finalUrl=h,C(s)}else{let u="";return this.events.next(new di(l.id,this.urlSerializer.serialize(l.extractedUrl),u,Hr.IgnoredByUrlHandlingStrategy)),l.resolve(!1),dt}}),H(l=>{let c=new Ba(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(c)}),R(l=>(this.currentTransition=s=j(f({},l),{guards:Lp(l.targetSnapshot,l.currentSnapshot,this.rootContexts)}),s)),Hp(this.environmentInjector,l=>this.events.next(l)),H(l=>{if(s.guardsResult=l.guardsResult,l.guardsResult&&typeof l.guardsResult!="boolean")throw Zr(this.urlSerializer,l.guardsResult);let c=new Ha(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(c)}),me(l=>l.guardsResult?!0:(this.cancelNavigationTransition(l,"",ct.GuardRejected),!1)),Ma(l=>{if(l.guards.canActivateChecks.length)return C(l).pipe(H(c=>{let d=new ja(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(d)}),ee(c=>{let d=!1;return C(c).pipe(hm(this.paramsInheritanceStrategy,this.environmentInjector),H({next:()=>d=!0,complete:()=>{d||this.cancelNavigationTransition(c,"",ct.NoDataFromResolver)}}))}),H(c=>{let d=new za(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(d)}))}),Ma(l=>{let c=d=>{let u=[];d.routeConfig?.loadComponent&&!d.routeConfig._loadedComponent&&u.push(this.configLoader.loadComponent(d.routeConfig).pipe(H(h=>{d.component=h}),R(()=>{})));for(let h of d.children)u.push(...c(h));return u};return $t(c(l.targetSnapshot.root)).pipe(da(null),ie(1))}),Ma(()=>this.afterPreactivation()),ee(()=>{let{currentSnapshot:l,targetSnapshot:c}=s,d=this.createViewTransition?.(this.environmentInjector,l.root,c.root);return d?$e(d).pipe(R(()=>s)):C(s)}),R(l=>{let c=Ep(e.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=s=j(f({},l),{targetRouterState:c}),this.currentNavigation.targetRouterState=c,s}),H(()=>{this.events.next(new Wn)}),Dp(this.rootContexts,e.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),ie(1),H({next:l=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new kt(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects))),this.titleStrategy?.updateTitle(l.targetRouterState.snapshot),l.resolve(!0)},complete:()=>{a=!0}}),Ue(this.transitionAbortSubject.pipe(H(l=>{throw l}))),br(()=>{!a&&!o&&this.cancelNavigationTransition(s,"",ct.SupersededByNewNavigation),this.currentTransition?.id===s.id&&(this.currentNavigation=null,this.currentTransition=null)}),ge(l=>{if(o=!0,yd(l))this.events.next(new Jt(s.id,this.urlSerializer.serialize(s.extractedUrl),l.message,l.cancellationCode)),xp(l)?this.events.next(new hn(l.url,l.navigationBehaviorOptions)):s.resolve(!1);else{let c=new zn(s.id,this.urlSerializer.serialize(s.extractedUrl),l,s.targetSnapshot??void 0);try{let d=Ut(this.environmentInjector,()=>this.navigationErrorHandler?.(c));if(d instanceof Kn){let{message:u,cancellationCode:h}=Zr(this.urlSerializer,d);this.events.next(new Jt(s.id,this.urlSerializer.serialize(s.extractedUrl),u,h)),this.events.next(new hn(d.redirectTo,d.navigationBehaviorOptions))}else{this.events.next(c);let u=e.errorHandler(l);s.resolve(!!u)}}catch(d){this.options.resolveNavigationPromiseOnError?s.resolve(!1):s.reject(d)}}return dt}))}))}cancelNavigationTransition(e,i,n){let s=new Jt(e.id,this.urlSerializer.serialize(e.extractedUrl),i,n);this.events.next(s),e.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){let e=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),i=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return e.toString()!==i?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function Tm(r){return r!==Bn}var wm=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:()=>b(Em),providedIn:"root"})}}return r})(),oo=class{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}},Em=(()=>{class r extends oo{static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=ze(r)))(n||r)}})()}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),Ld=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:()=>b(Am),providedIn:"root"})}}return r})(),Am=(()=>{class r extends Ld{constructor(){super(...arguments),this.location=b(Ai),this.urlSerializer=b(Qn),this.options=b(ir,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=b(po),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new ei,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=gd(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(e){return this.location.subscribe(i=>{i.type==="popstate"&&e(i.url,i.state)})}handleRouterEvent(e,i){if(e instanceof un)this.stateMemento=this.createStateMemento();else if(e instanceof di)this.rawUrlTree=i.initialUrl;else if(e instanceof jr){if(this.urlUpdateStrategy==="eager"&&!i.extras.skipLocationChange){let n=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl);this.setBrowserUrl(i.targetBrowserUrl??n,i)}}else e instanceof Wn?(this.currentUrlTree=i.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl),this.routerState=i.targetRouterState,this.urlUpdateStrategy==="deferred"&&!i.extras.skipLocationChange&&this.setBrowserUrl(i.targetBrowserUrl??this.rawUrlTree,i)):e instanceof Jt&&(e.code===ct.GuardRejected||e.code===ct.NoDataFromResolver)?this.restoreHistory(i):e instanceof zn?this.restoreHistory(i,!0):e instanceof kt&&(this.lastSuccessfulId=e.id,this.currentPageId=this.browserPageId)}setBrowserUrl(e,i){let n=e instanceof ei?this.urlSerializer.serialize(e):e;if(this.location.isCurrentPathEqualTo(n)||i.extras.replaceUrl){let s=this.browserPageId,a=f(f({},i.extras.state),this.generateNgRouterState(i.id,s));this.location.replaceState(n,"",a)}else{let s=f(f({},i.extras.state),this.generateNgRouterState(i.id,this.browserPageId+1));this.location.go(n,"",s)}}restoreHistory(e,i=!1){if(this.canceledNavigationResolution==="computed"){let n=this.browserPageId,s=this.currentPageId-n;s!==0?this.location.historyGo(s):this.currentUrlTree===e.finalUrl&&s===0&&(this.resetState(e),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(i&&this.resetState(e),this.resetUrlToCurrentUrlTree())}resetState(e){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(e,i){return this.canceledNavigationResolution==="computed"?{navigationId:e,\u0275routerPageId:i}:{navigationId:e}}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=ze(r)))(n||r)}})()}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),$n=function(r){return r[r.COMPLETE=0]="COMPLETE",r[r.FAILED=1]="FAILED",r[r.REDIRECTING=2]="REDIRECTING",r}($n||{});function kd(r,t){r.events.pipe(me(e=>e instanceof kt||e instanceof Jt||e instanceof zn||e instanceof di),R(e=>e instanceof kt||e instanceof di?$n.COMPLETE:(e instanceof Jt?e.code===ct.Redirect||e.code===ct.SupersededByNewNavigation:!1)?$n.REDIRECTING:$n.FAILED),me(e=>e!==$n.REDIRECTING),ie(1)).subscribe(()=>{t()})}function Rm(r){throw r}var xm={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},Dm={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},tt=(()=>{class r{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.console=b(Gl),this.stateManager=b(Ld),this.options=b(ir,{optional:!0})||{},this.pendingTasks=b(Nl),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=b(mo),this.urlSerializer=b(Qn),this.location=b(Ai),this.urlHandlingStrategy=b(po),this._events=new B,this.errorHandler=this.options.errorHandler||Rm,this.navigated=!1,this.routeReuseStrategy=b(wm),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=b(Xn,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!b(Jr,{optional:!0}),this.eventsSubscription=new qt,this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:e=>{this.console.warn(e)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){let e=this.navigationTransitions.events.subscribe(i=>{try{let n=this.navigationTransitions.currentTransition,s=this.navigationTransitions.currentNavigation;if(n!==null&&s!==null){if(this.stateManager.handleRouterEvent(i,s),i instanceof Jt&&i.code!==ct.Redirect&&i.code!==ct.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof kt)this.navigated=!0;else if(i instanceof hn){let a=i.navigationBehaviorOptions,o=this.urlHandlingStrategy.merge(i.url,n.currentRawUrl),l=f({browserUrl:n.extras.browserUrl,info:n.extras.info,skipLocationChange:n.extras.skipLocationChange,replaceUrl:n.extras.replaceUrl||this.urlUpdateStrategy==="eager"||Tm(n.source)},a);this.scheduleNavigation(o,Bn,null,l,{resolve:n.resolve,reject:n.reject,promise:n.promise})}}km(i)&&this._events.next(i)}catch(n){this.navigationTransitions.transitionAbortSubject.next(n)}});this.eventsSubscription.add(e)}resetRootComponentType(e){this.routerState.root.component=e,this.navigationTransitions.rootComponentType=e}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Bn,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((e,i)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(e,"popstate",i)},0)})}navigateToSyncWithBrowser(e,i,n){let s={replaceUrl:!0},a=n?.navigationId?n:null;if(n){let l=f({},n);delete l.navigationId,delete l.\u0275routerPageId,Object.keys(l).length!==0&&(s.state=l)}let o=this.parseUrl(e);this.scheduleNavigation(o,i,a,s)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(e){this.config=e.map(uo),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(e,i={}){let{relativeTo:n,queryParams:s,fragment:a,queryParamsHandling:o,preserveFragment:l}=i,c=l?this.currentUrlTree.fragment:a,d=null;switch(o??this.options.defaultQueryParamsHandling){case"merge":d=f(f({},this.currentUrlTree.queryParams),s);break;case"preserve":d=this.currentUrlTree.queryParams;break;default:d=s||null}d!==null&&(d=this.removeEmptyProps(d));let u;try{let h=n?n.snapshot:this.routerState.snapshot.root;u=hd(h)}catch{(typeof e[0]!="string"||e[0][0]!=="/")&&(e=[]),u=this.currentUrlTree.root}return pd(u,e,d,c??null)}navigateByUrl(e,i={skipLocationChange:!1}){let n=ki(e)?e:this.parseUrl(e),s=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(s,Bn,null,i)}navigate(e,i={skipLocationChange:!1}){return Lm(e),this.navigateByUrl(this.createUrlTree(e,i),i)}serializeUrl(e){return this.urlSerializer.serialize(e)}parseUrl(e){try{return this.urlSerializer.parse(e)}catch{return this.urlSerializer.parse("/")}}isActive(e,i){let n;if(i===!0?n=f({},xm):i===!1?n=f({},Dm):n=i,ki(e))return Wc(this.currentUrlTree,e,n);let s=this.parseUrl(e);return Wc(this.currentUrlTree,s,n)}removeEmptyProps(e){return Object.entries(e).reduce((i,[n,s])=>(s!=null&&(i[n]=s),i),{})}scheduleNavigation(e,i,n,s,a){if(this.disposed)return Promise.resolve(!1);let o,l,c;a?(o=a.resolve,l=a.reject,c=a.promise):c=new Promise((u,h)=>{o=u,l=h});let d=this.pendingTasks.add();return kd(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(d))}),this.navigationTransitions.handleNavigationRequest({source:i,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:e,extras:s,resolve:o,reject:l,promise:c,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),c.catch(u=>Promise.reject(u))}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function Lm(r){for(let t=0;t{class r{constructor(e,i,n,s,a,o){this.router=e,this.route=i,this.tabIndexAttribute=n,this.renderer=s,this.el=a,this.locationStrategy=o,this.href=null,this.onChanges=new B,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1,this.routerLinkInput=null;let l=a.nativeElement.tagName?.toLowerCase();this.isAnchorElement=l==="a"||l==="area",this.isAnchorElement?this.subscription=e.events.subscribe(c=>{c instanceof kt&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(e){this.tabIndexAttribute!=null||this.isAnchorElement||this.applyAttributeValue("tabindex",e)}ngOnChanges(e){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(e){e==null?(this.routerLinkInput=null,this.setTabIndexIfNotOnNativeEl(null)):(ki(e)?this.routerLinkInput=e:this.routerLinkInput=Array.isArray(e)?e:[e],this.setTabIndexIfNotOnNativeEl("0"))}onClick(e,i,n,s,a){let o=this.urlTree;if(o===null||this.isAnchorElement&&(e!==0||i||n||s||a||typeof this.target=="string"&&this.target!="_self"))return!0;let l={skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info};return this.router.navigateByUrl(o,l),!this.isAnchorElement}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){let e=this.urlTree;this.href=e!==null&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(e)):null;let i=this.href===null?null:Ul(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",i)}applyAttributeValue(e,i){let n=this.renderer,s=this.el.nativeElement;i!==null?n.setAttribute(s,e,i):n.removeAttribute(s,e)}get urlTree(){return this.routerLinkInput===null?null:ki(this.routerLinkInput)?this.routerLinkInput:this.router.createUrlTree(this.routerLinkInput,{relativeTo:this.relativeTo!==void 0?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static{this.\u0275fac=function(i){return new(i||r)(S(tt),S(_t),Ml("tabindex"),S(ht),S(Ie),S(On))}}static{this.\u0275dir=Se({type:r,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(i,n){i&1&&xe("click",function(a){return n.onClick(a.button,a.ctrlKey,a.shiftKey,a.altKey,a.metaKey)}),i&2&&Z("target",n.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[2,"preserveFragment","preserveFragment",J],skipLocationChange:[2,"skipLocationChange","skipLocationChange",J],replaceUrl:[2,"replaceUrl","replaceUrl",J],routerLink:"routerLink"},standalone:!0,features:[Be,nt]})}}return r})(),Pd=(()=>{class r{get isActive(){return this._isActive}constructor(e,i,n,s,a){this.router=e,this.element=i,this.renderer=n,this.cdr=s,this.link=a,this.classes=[],this._isActive=!1,this.routerLinkActiveOptions={exact:!1},this.isActiveChange=new W,this.routerEventsSubscription=e.events.subscribe(o=>{o instanceof kt&&this.update()})}ngAfterContentInit(){C(this.links.changes,C(null)).pipe(xn()).subscribe(e=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){this.linkInputChangesSubscription?.unsubscribe();let e=[...this.links.toArray(),this.link].filter(i=>!!i).map(i=>i.onChanges);this.linkInputChangesSubscription=$e(e).pipe(xn()).subscribe(i=>{this._isActive!==this.isLinkActive(this.router)(i)&&this.update()})}set routerLinkActive(e){let i=Array.isArray(e)?e:e.split(" ");this.classes=i.filter(n=>!!n)}ngOnChanges(e){this.update()}ngOnDestroy(){this.routerEventsSubscription.unsubscribe(),this.linkInputChangesSubscription?.unsubscribe()}update(){!this.links||!this.router.navigated||queueMicrotask(()=>{let e=this.hasActiveLinks();this.classes.forEach(i=>{e?this.renderer.addClass(this.element.nativeElement,i):this.renderer.removeClass(this.element.nativeElement,i)}),e&&this.ariaCurrentWhenActive!==void 0?this.renderer.setAttribute(this.element.nativeElement,"aria-current",this.ariaCurrentWhenActive.toString()):this.renderer.removeAttribute(this.element.nativeElement,"aria-current"),this._isActive!==e&&(this._isActive=e,this.cdr.markForCheck(),this.isActiveChange.emit(e))})}isLinkActive(e){let i=Pm(this.routerLinkActiveOptions)?this.routerLinkActiveOptions:this.routerLinkActiveOptions.exact||!1;return n=>{let s=n.urlTree;return s?e.isActive(s,i):!1}}hasActiveLinks(){let e=this.isLinkActive(this.router);return this.link&&e(this.link)||this.links.some(e)}static{this.\u0275fac=function(i){return new(i||r)(S(tt),S(Ie),S(ht),S(Ne),S(Yr,8))}}static{this.\u0275dir=Se({type:r,selectors:[["","routerLinkActive",""]],contentQueries:function(i,n,s){if(i&1&&rt(s,Yr,5),i&2){let a;Te(a=we())&&(n.links=a)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",ariaCurrentWhenActive:"ariaCurrentWhenActive",routerLinkActive:"routerLinkActive"},outputs:{isActiveChange:"isActiveChange"},exportAs:["routerLinkActive"],standalone:!0,features:[nt]})}}return r})();function Pm(r){return!!r.paths}var Qr=class{};var Om=(()=>{class r{constructor(e,i,n,s,a){this.router=e,this.injector=n,this.preloadingStrategy=s,this.loader=a}setUpPreloading(){this.subscription=this.router.events.pipe(me(e=>e instanceof kt),si(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(e,i){let n=[];for(let s of i){s.providers&&!s._injector&&(s._injector=ga(s.providers,e,`Route: ${s.path}`));let a=s._injector??e,o=s._loadedInjector??a;(s.loadChildren&&!s._loadedRoutes&&s.canLoad===void 0||s.loadComponent&&!s._loadedComponent)&&n.push(this.preloadConfig(a,s)),(s.children||s._loadedRoutes)&&n.push(this.processRoutes(o,s.children??s._loadedRoutes))}return $e(n).pipe(xn())}preloadConfig(e,i){return this.preloadingStrategy.preload(i,()=>{let n;i.loadChildren&&i.canLoad===void 0?n=this.loader.loadChildren(e,i):n=C(null);let s=n.pipe(ke(a=>a===null?C(void 0):(i._loadedRoutes=a.routes,i._loadedInjector=a.injector,this.processRoutes(a.injector??e,a.routes))));if(i.loadComponent&&!i._loadedComponent){let a=this.loader.loadComponent(i);return $e([s,a]).pipe(xn())}else return s})}static{this.\u0275fac=function(i){return new(i||r)(D(tt),D(xr),D(Ti),D(Qr),D(ho))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),Od=new ae(""),Mm=(()=>{class r{constructor(e,i,n,s,a={}){this.urlSerializer=e,this.transitions=i,this.viewportScroller=n,this.zone=s,this.options=a,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},a.scrollPositionRestoration||="disabled",a.anchorScrolling||="disabled"}init(){this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(e=>{e instanceof un?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof kt?(this.lastId=e.id,this.scheduleScrollEvent(e,this.urlSerializer.parse(e.urlAfterRedirects).fragment)):e instanceof di&&e.code===Hr.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(e,this.urlSerializer.parse(e.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(e=>{e instanceof zr&&(e.position?this.options.scrollPositionRestoration==="top"?this.viewportScroller.scrollToPosition([0,0]):this.options.scrollPositionRestoration==="enabled"&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&this.options.anchorScrolling==="enabled"?this.viewportScroller.scrollToAnchor(e.anchor):this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,i){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new zr(e,this.lastSource==="popstate"?this.store[this.restoredId]:null,i))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static{this.\u0275fac=function(i){Er()}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac})}}return r})();function Md(r,...t){return Ir([{provide:Xn,multi:!0,useValue:r},[],{provide:_t,useFactory:Nd,deps:[tt]},{provide:ba,multi:!0,useFactory:Fd},t.map(e=>e.\u0275providers)])}function Nd(r){return r.routerState.root}function nr(r,t){return{\u0275kind:r,\u0275providers:t}}function Fd(){let r=b(Zt);return t=>{let e=r.get(Rr);if(t!==e.components[0])return;let i=r.get(tt),n=r.get(Vd);r.get(fo)===1&&i.initialNavigation(),r.get($d,null,pa.Optional)?.setUpPreloading(),r.get(Od,null,pa.Optional)?.init(),i.resetRootComponentType(e.componentTypes[0]),n.closed||(n.next(),n.complete(),n.unsubscribe())}}var Vd=new ae("",{factory:()=>new B}),fo=new ae("",{providedIn:"root",factory:()=>1});function Nm(){return nr(2,[{provide:fo,useValue:0},{provide:Zi,multi:!0,deps:[Zt],useFactory:t=>{let e=t.get(Yl,Promise.resolve());return()=>e.then(()=>new Promise(i=>{let n=t.get(tt),s=t.get(Vd);kd(n,()=>{i(!0)}),t.get(mo).afterPreactivation=()=>(i(!0),s.closed?C(void 0):s),n.initialNavigation()}))}}])}function Fm(){return nr(3,[{provide:Zi,multi:!0,useFactory:()=>{let t=b(tt);return()=>{t.setUpLocationChangeListener()}}},{provide:fo,useValue:2}])}var $d=new ae("");function Vm(r){return nr(0,[{provide:$d,useExisting:Om},{provide:Qr,useExisting:r}])}function $m(){return nr(8,[Zc,{provide:Jr,useExisting:Zc}])}function Um(r){let t=[{provide:xd,useValue:ym},{provide:Dd,useValue:f({skipNextTransition:!!r?.skipInitialTransition},r)}];return nr(9,t)}var Jc=new ae("ROUTER_FORROOT_GUARD"),Bm=[Ai,{provide:Qn,useClass:dn},tt,er,{provide:_t,useFactory:Nd,deps:[tt]},ho,[]],go=(()=>{class r{constructor(e){}static forRoot(e,i){return{ngModule:r,providers:[Bm,[],{provide:Xn,multi:!0,useValue:e},{provide:Jc,useFactory:Wm,deps:[[tt,new kl,new Pl]]},{provide:ir,useValue:i||{}},i?.useHash?jm():zm(),Hm(),i?.preloadingStrategy?Vm(i.preloadingStrategy).\u0275providers:[],i?.initialNavigation?Gm(i):[],i?.bindToComponentInputs?$m().\u0275providers:[],i?.enableViewTransitions?Um().\u0275providers:[],Km()]}}static forChild(e){return{ngModule:r,providers:[{provide:Xn,multi:!0,useValue:e}]}}static{this.\u0275fac=function(i){return new(i||r)(D(Jc,8))}}static{this.\u0275mod=Ce({type:r})}static{this.\u0275inj=_e({})}}return r})();function Hm(){return{provide:Od,useFactory:()=>{let r=b(ic),t=b(Re),e=b(ir),i=b(mo),n=b(Qn);return e.scrollOffset&&r.setOffset(e.scrollOffset),new Mm(n,i,r,t,e)}}}function jm(){return{provide:On,useClass:Jl}}function zm(){return{provide:On,useClass:Ql}}function Wm(r){return"guarded"}function Gm(r){return[r.initialNavigation==="disabled"?Fm().\u0275providers:[],r.initialNavigation==="enabledBlocking"?Nm().\u0275providers:[]]}var ed=new ae("");function Km(){return[{provide:ed,useFactory:Fd},{provide:ba,multi:!0,useExisting:ed}]}var hi=class{},Ud=(()=>{class r extends hi{getTranslation(e){return C({})}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ze(r)))(n||r)}})();static \u0275prov=E({token:r,factory:r.\u0275fac})}return r})(),rr=class{},Bd=(()=>{class r{handle(e){return e.key}static \u0275fac=function(i){return new(i||r)};static \u0275prov=E({token:r,factory:r.\u0275fac})}return r})();function Pi(r){return typeof r<"u"&&r!==null}function Co(r){return r&&typeof r=="object"&&!Array.isArray(r)}function zd(r,t){let e=Object.assign({},r);return Co(r)&&Co(t)&&Object.keys(t).forEach(i=>{Co(t[i])?i in r?e[i]=zd(r[i],t[i]):Object.assign(e,{[i]:t[i]}):Object.assign(e,{[i]:t[i]})}),e}var fn=class{},Hd=(()=>{class r extends fn{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(e,i){let n;return typeof e=="string"?n=this.interpolateString(e,i):typeof e=="function"?n=this.interpolateFunction(e,i):n=e,n}getValue(e,i){let n=typeof i=="string"?i.split("."):[i];i="";do i+=n.shift(),Pi(e)&&Pi(e[i])&&(typeof e[i]=="object"||!n.length)?(e=e[i],i=""):n.length?i+=".":e=void 0;while(n.length);return e}interpolateFunction(e,i){return e(i)}interpolateString(e,i){return i?e.replace(this.templateMatcher,(n,s)=>{let a=this.getValue(i,s);return Pi(a)?a:n}):e}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ze(r)))(n||r)}})();static \u0275prov=E({token:r,factory:r.\u0275fac})}return r})(),gn=class{},jd=(()=>{class r extends gn{compile(e,i){return e}compileTranslations(e,i){return e}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ze(r)))(n||r)}})();static \u0275prov=E({token:r,factory:r.\u0275fac})}return r})(),ts=class{defaultLang;currentLang=this.defaultLang;translations={};langs=[];onTranslationChange=new W;onLangChange=new W;onDefaultLangChange=new W},vo=new ae("USE_STORE"),bo=new ae("USE_DEFAULT_LANG"),yo=new ae("DEFAULT_LANGUAGE"),So=new ae("USE_EXTEND"),_n=(()=>{class r{store;currentLoader;compiler;parser;missingTranslationHandler;useDefaultLang;isolate;extend;loadingTranslations;pending=!1;_onTranslationChange=new W;_onLangChange=new W;_onDefaultLangChange=new W;_defaultLang;_currentLang;_langs=[];_translations={};_translationRequests={};get onTranslationChange(){return this.isolate?this._onTranslationChange:this.store.onTranslationChange}get onLangChange(){return this.isolate?this._onLangChange:this.store.onLangChange}get onDefaultLangChange(){return this.isolate?this._onDefaultLangChange:this.store.onDefaultLangChange}get defaultLang(){return this.isolate?this._defaultLang:this.store.defaultLang}set defaultLang(e){this.isolate?this._defaultLang=e:this.store.defaultLang=e}get currentLang(){return this.isolate?this._currentLang:this.store.currentLang}set currentLang(e){this.isolate?this._currentLang=e:this.store.currentLang=e}get langs(){return this.isolate?this._langs:this.store.langs}set langs(e){this.isolate?this._langs=e:this.store.langs=e}get translations(){return this.isolate?this._translations:this.store.translations}set translations(e){this.isolate?this._translations=e:this.store.translations=e}constructor(e,i,n,s,a,o=!0,l=!1,c=!1,d){this.store=e,this.currentLoader=i,this.compiler=n,this.parser=s,this.missingTranslationHandler=a,this.useDefaultLang=o,this.isolate=l,this.extend=c,d&&this.setDefaultLang(d)}setDefaultLang(e){if(e===this.defaultLang)return;let i=this.retrieveTranslations(e);typeof i<"u"?(this.defaultLang==null&&(this.defaultLang=e),i.pipe(ie(1)).subscribe(n=>{this.changeDefaultLang(e)})):this.changeDefaultLang(e)}getDefaultLang(){return this.defaultLang}use(e){if(e===this.currentLang)return C(this.translations[e]);let i=this.retrieveTranslations(e);return typeof i<"u"?(this.currentLang||(this.currentLang=e),i.pipe(ie(1)).subscribe(n=>{this.changeLang(e)}),i):(this.changeLang(e),C(this.translations[e]))}retrieveTranslations(e){let i;return(typeof this.translations[e]>"u"||this.extend)&&(this._translationRequests[e]=this._translationRequests[e]||this.getTranslation(e),i=this._translationRequests[e]),i}getTranslation(e){this.pending=!0;let i=this.currentLoader.getTranslation(e).pipe(Gi(1),ie(1));return this.loadingTranslations=i.pipe(R(n=>this.compiler.compileTranslations(n,e)),Gi(1),ie(1)),this.loadingTranslations.subscribe({next:n=>{this.translations[e]=this.extend&&this.translations[e]?f(f({},n),this.translations[e]):n,this.updateLangs(),this.pending=!1},error:n=>{this.pending=!1}}),i}setTranslation(e,i,n=!1){i=this.compiler.compileTranslations(i,e),(n||this.extend)&&this.translations[e]?this.translations[e]=zd(this.translations[e],i):this.translations[e]=i,this.updateLangs(),this.onTranslationChange.emit({lang:e,translations:this.translations[e]})}getLangs(){return this.langs}addLangs(e){e.forEach(i=>{this.langs.indexOf(i)===-1&&this.langs.push(i)})}updateLangs(){this.addLangs(Object.keys(this.translations))}getParsedResult(e,i,n){let s;if(i instanceof Array){let a={},o=!1;for(let l of i)a[l]=this.getParsedResult(e,l,n),Vt(a[l])&&(o=!0);if(o){let l=i.map(c=>Vt(a[c])?a[c]:C(a[c]));return Tl(l).pipe(R(c=>{let d={};return c.forEach((u,h)=>{d[i[h]]=u}),d}))}return a}if(e&&(s=this.parser.interpolate(this.parser.getValue(e,i),n)),typeof s>"u"&&this.defaultLang!=null&&this.defaultLang!==this.currentLang&&this.useDefaultLang&&(s=this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang],i),n)),typeof s>"u"){let a={key:i,translateService:this};typeof n<"u"&&(a.interpolateParams=n),s=this.missingTranslationHandler.handle(a)}return typeof s<"u"?s:i}get(e,i){if(!Pi(e)||!e.length)throw new Error('Parameter "key" required');if(this.pending)return this.loadingTranslations.pipe(si(n=>(n=this.getParsedResult(n,e,i),Vt(n)?n:C(n))));{let n=this.getParsedResult(this.translations[this.currentLang],e,i);return Vt(n)?n:C(n)}}getStreamOnTranslationChange(e,i){if(!Pi(e)||!e.length)throw new Error('Parameter "key" required');return yi(ji(()=>this.get(e,i)),this.onTranslationChange.pipe(ee(n=>{let s=this.getParsedResult(n.translations,e,i);return typeof s.subscribe=="function"?s:C(s)})))}stream(e,i){if(!Pi(e)||!e.length)throw new Error('Parameter "key" required');return yi(ji(()=>this.get(e,i)),this.onLangChange.pipe(ee(n=>{let s=this.getParsedResult(n.translations,e,i);return Vt(s)?s:C(s)})))}instant(e,i){if(!Pi(e)||!e.length)throw new Error('Parameter "key" required');let n=this.getParsedResult(this.translations[this.currentLang],e,i);if(Vt(n)){if(e instanceof Array){let s={};return e.forEach((a,o)=>{s[e[o]]=e[o]}),s}return e}else return n}set(e,i,n=this.currentLang){this.translations[n][e]=this.compiler.compile(i,n),this.updateLangs(),this.onTranslationChange.emit({lang:n,translations:this.translations[n]})}changeLang(e){this.currentLang=e,this.onLangChange.emit({lang:e,translations:this.translations[e]}),this.defaultLang==null&&this.changeDefaultLang(e)}changeDefaultLang(e){this.defaultLang=e,this.onDefaultLangChange.emit({lang:e,translations:this.translations[e]})}reloadLang(e){return this.resetLang(e),this.getTranslation(e)}resetLang(e){this._translationRequests[e]=void 0,this.translations[e]=void 0}getBrowserLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let e=window.navigator.languages?window.navigator.languages[0]:null;if(e=e||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,!(typeof e>"u"))return e.indexOf("-")!==-1&&(e=e.split("-")[0]),e.indexOf("_")!==-1&&(e=e.split("_")[0]),e}getBrowserCultureLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let e=window.navigator.languages?window.navigator.languages[0]:null;return e=e||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,e}static \u0275fac=function(i){return new(i||r)(D(ts),D(hi),D(gn),D(fn),D(rr),D(bo),D(vo),D(So),D(yo))};static \u0275prov=E({token:r,factory:r.\u0275fac})}return r})();var is=(()=>{class r{static forRoot(e={}){return{ngModule:r,providers:[e.loader||{provide:hi,useClass:Ud},e.compiler||{provide:gn,useClass:jd},e.parser||{provide:fn,useClass:Hd},e.missingTranslationHandler||{provide:rr,useClass:Bd},ts,{provide:vo,useValue:e.isolate},{provide:bo,useValue:e.useDefaultLang},{provide:So,useValue:e.extend},{provide:yo,useValue:e.defaultLanguage},_n]}}static forChild(e={}){return{ngModule:r,providers:[e.loader||{provide:hi,useClass:Ud},e.compiler||{provide:gn,useClass:jd},e.parser||{provide:fn,useClass:Hd},e.missingTranslationHandler||{provide:rr,useClass:Bd},{provide:vo,useValue:e.isolate},{provide:bo,useValue:e.useDefaultLang},{provide:So,useValue:e.extend},{provide:yo,useValue:e.defaultLanguage},_n]}}static \u0275fac=function(i){return new(i||r)};static \u0275mod=Ce({type:r});static \u0275inj=_e({})}return r})();var Gd=(i=>(i.P0="P0",i.P20="P20",i.P100="P100",i))(Gd||{}),Wd={P0:"free",P20:"standard",P100:"premium"},J_=Object.values(Gd),Kd=["P100","P20"],e0=[Wd.P100,Wd.P20];var qd="\u0621-\u064A\u0660-\u0669",eu="\u4E00-\u9FCC\u3400-\u4DB5\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29",tu="\uD840-\uD868",iu="\uDC00-\uDFFF",nu="\uD869",ru="\uDC00-\uDED6\uDF00-\uDFFF",su="\uD86A-\uD86C",au="\uDC00-\uDFFF",ou="\uD86D",lu="\uDC00-\uDF34\uDF40-\uDFFF",cu="\uDC00-\uDC1D",qm=`[${eu}]|[${tu}][${iu}]|${nu}[${ru}]|[${su}][${au}]|${ou}[${lu}]|[${cu}]`,Zm=`${eu}${tu}${iu}${nu}${ru}${su}${au}${ou}${lu}${cu}`,Zd="\u0900-\u097F",Xd="\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFF9F\u4E00-\u9FAF\u3400-\u4DBF",Yd="\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF",Qd="\u0430-\u044F",Xm="\uD835",Jd=[{char:"&",entity:"&"},{char:"<",entity:"<"},{char:">",entity:">"},{char:"'",entity:"'"},{char:'"',entity:"""}],Ae=class r{static{this.REGEX_IS_EMOJI=new RegExp("\\p{Extended_Pictographic}","gu")}static{this.REGEX_ONLY_REAL=/^(\d+|\d{1,3}(,\d{3})*)?(\.\d+)?$/}static{this.REGEX_SAFE_STRING=new RegExp("<\\/?[a-z][\\s\\S]*>","g")}static{this.REGEX_HEX_COLOR=/^#([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/}static{this.REGEX_ARABIC_CHARACTERS=new RegExp(`[${qd}]`,"g")}static{this.REGEX_CHINESE_CHARACTERS=new RegExp(`${qm}`,"g")}static{this.REGEX_INDIAN_CHARACTERS=new RegExp(`[${Zd}]`,"g")}static{this.REGEX_JAPANESE_CHARACTERS=new RegExp(`[${Xd}]`,"g")}static{this.REGEX_KOREAN_CHARACTERS=new RegExp(`[${Yd}]`,"g")}static{this.REGEX_RUSSIAN_CHARACTERS=new RegExp(`[${Qd}]`,"g")}static{this.REGEX_UNICODE_SLICE_ERROR=new RegExp(`[${Xm}]`)}static{this.EXCLUDE_OTHER_ALPHABETS_CHARACTERS=new RegExp(`[^${qd}${Zm}${Zd}${Xd}${Yd}${Qd}]`,"g")}static safeText(t,e=30,i=[]){let n=`${t}`,s=Jd.filter(o=>!i.includes(o.char));for(let o of s){let l;o.char==="&"?l=new RegExp("&(?![a-zA-Z0-9]+;)","g"):l=new RegExp(o.char,"g"),n=n.replace(l,o.entity)}let a=n.slice(0,e).trim();return this.REGEX_UNICODE_SLICE_ERROR.test(a)?this.removeBoldCharacters(n).slice(0,e).trim():a}static containsSpecialHTMLEntities(t){return Jd.some(e=>new RegExp(e.entity,"g").test(`${t}`))}static hasEmojis(t){return!!t.match(this.REGEX_IS_EMOJI)}static removeEmojis(t){return t.replace(this.REGEX_IS_EMOJI,"")}static revertHtmlEntities(t){return t.replace(/(")|(')/g,"'").replace(/&/g,"&")}static ellipsis(t,e,i="..."){return t.length>e?`${t.slice(0,e)}${i.length>0?i:"..."}`:t}static removeNonUTFCharacters(t){return t.replace(r.REGEX_ARABIC_CHARACTERS,"").replace(r.REGEX_CHINESE_CHARACTERS,"").replace(r.REGEX_INDIAN_CHARACTERS,"").replace(r.REGEX_JAPANESE_CHARACTERS,"").replace(r.REGEX_KOREAN_CHARACTERS,"").replace(r.REGEX_RUSSIAN_CHARACTERS,"")}static removeUTFCharacters(t){return t.replace(r.EXCLUDE_OTHER_ALPHABETS_CHARACTERS,"")}static removeBoldCharacters(t){let e={"\u{1D5D4}":"A","\u{1D5D5}":"B","\u{1D5D6}":"C","\u{1D5D7}":"D","\u{1D5D8}":"E","\u{1D5D9}":"F","\u{1D5DA}":"G","\u{1D5DB}":"H","\u{1D5DC}":"I","\u{1D5DD}":"J","\u{1D5DE}":"K","\u{1D5DF}":"L","\u{1D5E0}":"M","\u{1D5E1}":"N","\u{1D5E2}":"O","\u{1D5E3}":"P","\u{1D5E4}":"Q","\u{1D5E5}":"R","\u{1D5E6}":"S","\u{1D5E7}":"T","\u{1D5E8}":"U","\u{1D5E9}":"V","\u{1D5EA}":"W","\u{1D5EB}":"X","\u{1D5EC}":"Y","\u{1D5ED}":"Z","\u{1D5EE}":"a","\u{1D5EF}":"b","\u{1D5F0}":"c","\u{1D5F1}":"d","\u{1D5F2}":"e","\u{1D5F3}":"f","\u{1D5F4}":"g","\u{1D5F5}":"h","\u{1D5F6}":"i","\u{1D5F7}":"j","\u{1D5F8}":"k","\u{1D5F9}":"l","\u{1D5FA}":"m","\u{1D5FB}":"n","\u{1D5FC}":"o","\u{1D5FD}":"p","\u{1D5FE}":"q","\u{1D5FF}":"r","\u{1D600}":"s","\u{1D601}":"t","\u{1D602}":"u","\u{1D603}":"v","\u{1D604}":"w","\u{1D605}":"x","\u{1D606}":"y","\u{1D607}":"z"},i="";for(let n of t)i+=e[n]||n;return i}};var pi=class{static normalizeUrl(t){return t?.trim()?t.startsWith("http://")||t.startsWith("https://")?t:`https://${t.replace(/^https?:/,"")}`:""}static removeQueryParams(t,e){for(let i of e)t.searchParams.delete(i);return t}static encodeStringAsURIComponent(t){return encodeURIComponent(t)}static removeLangAndScopeFromUrl(t,e,i){return t.replace(e,"").replace(`/${i}`,"")}static addQueryParamToUrl(t,e,i){let n=new URL(t);return n.searchParams.set(e,i),n.href}static isExternalUrl(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//")}static shareOn(t,e,i,n,s,a){let o=`${i}/${t}`,l=this.removeQueryParams(new URL(window.location.href),a??[]),c=n&&l.pathname.includes(n)?`${n}/${e}`:e;return`${l.href.replace(c,o)}/${s}`}static isHttpsUrl(t){return t.startsWith("https://")}};var be=class r{static isArray(t,e=!0){return Array.isArray(t)&&(e||t.length!==0)}static isObject(t,e=!0){return typeof t=="object"&&!Array.isArray(t)&&t!=null&&(e||Object.keys(t).length!==0)}static equals(t,e,i){return i?this.resolveFieldData(t,i)===this.resolveFieldData(e,i):this.equalsByValue(t,e)}static equalsByValue(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var i=Array.isArray(t),n=Array.isArray(e),s,a,o;if(i&&n){if(a=t.length,a!=e.length)return!1;for(s=a;s--!==0;)if(!this.equalsByValue(t[s],e[s]))return!1;return!0}if(i!=n)return!1;var l=this.isDate(t),c=this.isDate(e);if(l!=c)return!1;if(l&&c)return t.getTime()==e.getTime();var d=t instanceof RegExp,u=e instanceof RegExp;if(d!=u)return!1;if(d&&u)return t.toString()==e.toString();var h=Object.keys(t);if(a=h.length,a!==Object.keys(e).length)return!1;for(s=a;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,h[s]))return!1;for(s=a;s--!==0;)if(o=h[s],!this.equalsByValue(t[o],e[o]))return!1;return!0}return t!==t&&e!==e}static resolveFieldData(t,e){if(t&&e){if(this.isFunction(e))return e(t);if(e.indexOf(".")==-1)return t[e];{let i=e.split("."),n=t;for(let s=0,a=i.length;s=t.length&&(i%=t.length,e%=t.length),t.splice(i,0,t.splice(e,1)[0]))}static insertIntoOrderedArray(t,e,i,n){if(i.length>0){let s=!1;for(let a=0;ae){i.splice(a,0,t),s=!0;break}s||i.push(t)}else i.push(t)}static findIndexInList(t,e){let i=-1;if(e){for(let n=0;ne?1:0,s}static sort(t,e,i=1,n,s=1){let a=r.compare(t,e,n,i),o=i;return(r.isEmpty(t)||r.isEmpty(e))&&(o=s===1?i:s),o*a}static merge(t,e){if(!(t==null&&e==null)){{if((t==null||typeof t=="object")&&(e==null||typeof e=="object"))return f(f({},t||{}),e||{});if((t==null||typeof t=="string")&&(e==null||typeof e=="string"))return[t||"",e||""].join(" ")}return e||t}}static isPrintableCharacter(t=""){return this.isNotEmpty(t)&&t.length===1&&t.match(/\S| /)}static getItemValue(t,...e){return this.isFunction(t)?t(...e):t}static findLastIndex(t,e){let i=-1;if(this.isNotEmpty(t))try{i=t.findLastIndex(e)}catch{i=t.lastIndexOf([...t].reverse().find(e))}return i}static findLast(t,e){let i;if(this.isNotEmpty(t))try{i=t.findLast(e)}catch{i=[...t].reverse().find(e)}return i}static deepEquals(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var i=Array.isArray(t),n=Array.isArray(e),s,a,o;if(i&&n){if(a=t.length,a!=e.length)return!1;for(s=a;s--!==0;)if(!this.deepEquals(t[s],e[s]))return!1;return!0}if(i!=n)return!1;var l=t instanceof Date,c=e instanceof Date;if(l!=c)return!1;if(l&&c)return t.getTime()==e.getTime();var d=t instanceof RegExp,u=e instanceof RegExp;if(d!=u)return!1;if(d&&u)return t.toString()==e.toString();var h=Object.keys(t);if(a=h.length,a!==Object.keys(e).length)return!1;for(s=a;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,h[s]))return!1;for(s=a;s--!==0;)if(o=h[s],!this.deepEquals(t[o],e[o]))return!1;return!0}return t!==t&&e!==e}},du=0;function Cn(r="pn_id_"){return du++,`${r}${du}`}function Ym(){let r=[],t=(s,a)=>{let o=r.length>0?r[r.length-1]:{key:s,value:a},l=o.value+(o.key===s?0:a)+2;return r.push({key:s,value:l}),l},e=s=>{r=r.filter(a=>a.value!==s)},i=()=>r.length>0?r[r.length-1].value:0,n=s=>s&&parseInt(s.style.zIndex,10)||0;return{get:n,set:(s,a,o)=>{a&&(a.style.zIndex=String(t(s,o)))},clear:s=>{s&&(e(n(s)),s.style.zIndex="")},getCurrent:()=>i()}}var Oi=Ym();var uu=["*"];var je=(()=>{class r{static STARTS_WITH="startsWith";static CONTAINS="contains";static NOT_CONTAINS="notContains";static ENDS_WITH="endsWith";static EQUALS="equals";static NOT_EQUALS="notEquals";static IN="in";static LESS_THAN="lt";static LESS_THAN_OR_EQUAL_TO="lte";static GREATER_THAN="gt";static GREATER_THAN_OR_EQUAL_TO="gte";static BETWEEN="between";static IS="is";static IS_NOT="isNot";static BEFORE="before";static AFTER="after";static DATE_IS="dateIs";static DATE_IS_NOT="dateIsNot";static DATE_BEFORE="dateBefore";static DATE_AFTER="dateAfter"}return r})();var vn=(()=>{class r{ripple=!1;inputStyle=Me("outlined");overlayOptions={};csp=Me({nonce:void 0});filterMatchModeOptions={text:[je.STARTS_WITH,je.CONTAINS,je.NOT_CONTAINS,je.ENDS_WITH,je.EQUALS,je.NOT_EQUALS],numeric:[je.EQUALS,je.NOT_EQUALS,je.LESS_THAN,je.LESS_THAN_OR_EQUAL_TO,je.GREATER_THAN,je.GREATER_THAN_OR_EQUAL_TO],date:[je.DATE_IS,je.DATE_IS_NOT,je.DATE_BEFORE,je.DATE_AFTER]};translation={startsWith:"Starts with",contains:"Contains",notContains:"Not contains",endsWith:"Ends with",equals:"Equals",notEquals:"Not equals",noFilter:"No Filter",lt:"Less than",lte:"Less than or equal to",gt:"Greater than",gte:"Greater than or equal to",is:"Is",isNot:"Is not",before:"Before",after:"After",dateIs:"Date is",dateIsNot:"Date is not",dateBefore:"Date is before",dateAfter:"Date is after",clear:"Clear",apply:"Apply",matchAll:"Match All",matchAny:"Match Any",addRule:"Add Rule",removeRule:"Remove Rule",accept:"Yes",reject:"No",choose:"Choose",upload:"Upload",cancel:"Cancel",pending:"Pending",fileSizeTypes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],chooseYear:"Choose Year",chooseMonth:"Choose Month",chooseDate:"Choose Date",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",prevHour:"Previous Hour",nextHour:"Next Hour",prevMinute:"Previous Minute",nextMinute:"Next Minute",prevSecond:"Previous Second",nextSecond:"Next Second",am:"am",pm:"pm",dateFormat:"mm/dd/yy",firstDayOfWeek:0,today:"Today",weekHeader:"Wk",weak:"Weak",medium:"Medium",strong:"Strong",passwordPrompt:"Enter a password",emptyMessage:"No results found",searchMessage:"{0} results are available",selectionMessage:"{0} items selected",emptySelectionMessage:"No selected item",emptySearchMessage:"No results found",emptyFilterMessage:"No results found",aria:{trueLabel:"True",falseLabel:"False",nullLabel:"Not Selected",star:"1 star",stars:"{star} stars",selectAll:"All items selected",unselectAll:"All items unselected",close:"Close",previous:"Previous",next:"Next",navigation:"Navigation",scrollTop:"Scroll Top",moveTop:"Move Top",moveUp:"Move Up",moveDown:"Move Down",moveBottom:"Move Bottom",moveToTarget:"Move to Target",moveToSource:"Move to Source",moveAllToTarget:"Move All to Target",moveAllToSource:"Move All to Source",pageLabel:"{page}",firstPageLabel:"First Page",lastPageLabel:"Last Page",nextPageLabel:"Next Page",prevPageLabel:"Previous Page",rowsPerPageLabel:"Rows per page",previousPageLabel:"Previous Page",jumpToPageDropdownLabel:"Jump to Page Dropdown",jumpToPageInputLabel:"Jump to Page Input",selectRow:"Row Selected",unselectRow:"Row Unselected",expandRow:"Row Expanded",collapseRow:"Row Collapsed",showFilterMenu:"Show Filter Menu",hideFilterMenu:"Hide Filter Menu",filterOperator:"Filter Operator",filterConstraint:"Filter Constraint",editRow:"Row Edit",saveEdit:"Save Edit",cancelEdit:"Cancel Edit",listView:"List View",gridView:"Grid View",slide:"Slide",slideNumber:"{slideNumber}",zoomImage:"Zoom Image",zoomIn:"Zoom In",zoomOut:"Zoom Out",rotateRight:"Rotate Right",rotateLeft:"Rotate Left",listLabel:"Option List",selectColor:"Select a color",removeLabel:"Remove",browseFiles:"Browse Files",maximizeLabel:"Maximize"}};zIndex={modal:1100,overlay:1e3,menu:1e3,tooltip:1100};translationSource=new B;translationObserver=this.translationSource.asObservable();getTranslation(e){return this.translation[e]}setTranslation(e){this.translation=f(f({},this.translation),e),this.translationSource.next(this.translation)}static \u0275fac=function(i){return new(i||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),hu=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=Q({type:r,selectors:[["p-header"]],standalone:!0,features:[ue],ngContentSelectors:uu,decls:1,vars:0,template:function(i,n){i&1&&(mt(),Qe(0))},encapsulation:2})}return r})(),pu=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=Q({type:r,selectors:[["p-footer"]],standalone:!0,features:[ue],ngContentSelectors:uu,decls:1,vars:0,template:function(i,n){i&1&&(mt(),Qe(0))},encapsulation:2})}return r})(),mi=(()=>{class r{template;type;name;constructor(e){this.template=e}getType(){return this.name}static \u0275fac=function(i){return new(i||r)(S(Bt))};static \u0275dir=Se({type:r,selectors:[["","pTemplate",""]],inputs:{type:"type",name:[0,"pTemplate","name"]},standalone:!0})}return r})(),ti=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275mod=Ce({type:r});static \u0275inj=_e({})}return r})();var M=(()=>{class r{static zindex=1e3;static calculatedScrollbarWidth=null;static calculatedScrollbarHeight=null;static browser;static addClass(e,i){e&&i&&(e.classList?e.classList.add(i):e.className+=" "+i)}static addMultipleClasses(e,i){if(e&&i)if(e.classList){let n=i.trim().split(" ");for(let s=0;sn.split(" ").forEach(s=>this.removeClass(e,s)))}static hasClass(e,i){return e&&i?e.classList?e.classList.contains(i):new RegExp("(^| )"+i+"( |$)","gi").test(e.className):!1}static siblings(e){return Array.prototype.filter.call(e.parentNode.children,function(i){return i!==e})}static find(e,i){return Array.from(e.querySelectorAll(i))}static findSingle(e,i){return this.isElement(e)?e.querySelector(i):null}static index(e){let i=e.parentNode.childNodes,n=0;for(var s=0;s{if(k)return getComputedStyle(k).getPropertyValue("position")==="relative"?k:s(k.parentElement)},a=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),o=i.offsetHeight??i.getBoundingClientRect().height,l=i.getBoundingClientRect(),c=this.getWindowScrollTop(),d=this.getWindowScrollLeft(),u=this.getViewport(),p=s(e)?.getBoundingClientRect()||{top:-1*c,left:-1*d},m,A;l.top+o+a.height>u.height?(m=l.top-p.top-a.height,e.style.transformOrigin="bottom",l.top+m<0&&(m=-1*l.top)):(m=o+l.top-p.top,e.style.transformOrigin="top");let _=l.left+a.width-u.width,x=l.left-p.left;a.width>u.width?A=(l.left-p.left)*-1:_>0?A=x-_:A=l.left-p.left,e.style.top=m+"px",e.style.left=A+"px",n&&(e.style.marginTop=origin==="bottom"?"calc(var(--p-anchor-gutter) * -1)":"calc(var(--p-anchor-gutter))")}static absolutePosition(e,i,n=!0){let s=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),a=s.height,o=s.width,l=i.offsetHeight??i.getBoundingClientRect().height,c=i.offsetWidth??i.getBoundingClientRect().width,d=i.getBoundingClientRect(),u=this.getWindowScrollTop(),h=this.getWindowScrollLeft(),p=this.getViewport(),m,A;d.top+l+a>p.height?(m=d.top+u-a,e.style.transformOrigin="bottom",m<0&&(m=u)):(m=l+d.top+u,e.style.transformOrigin="top"),d.left+o>p.width?A=Math.max(0,d.left+h+c-o):A=d.left+h,e.style.top=m+"px",e.style.left=A+"px",n&&(e.style.marginTop=origin==="bottom"?"calc(var(--p-anchor-gutter) * -1)":"calc(var(--p-anchor-gutter))")}static getParents(e,i=[]){return e.parentNode===null?i:this.getParents(e.parentNode,i.concat([e.parentNode]))}static getScrollableParents(e){let i=[];if(e){let n=this.getParents(e),s=/(auto|scroll)/,a=o=>{let l=window.getComputedStyle(o,null);return s.test(l.getPropertyValue("overflow"))||s.test(l.getPropertyValue("overflowX"))||s.test(l.getPropertyValue("overflowY"))};for(let o of n){let l=o.nodeType===1&&o.dataset.scrollselectors;if(l){let c=l.split(",");for(let d of c){let u=this.findSingle(o,d);u&&a(u)&&i.push(u)}}o.nodeType!==9&&a(o)&&i.push(o)}}return i}static getHiddenElementOuterHeight(e){e.style.visibility="hidden",e.style.display="block";let i=e.offsetHeight;return e.style.display="none",e.style.visibility="visible",i}static getHiddenElementOuterWidth(e){e.style.visibility="hidden",e.style.display="block";let i=e.offsetWidth;return e.style.display="none",e.style.visibility="visible",i}static getHiddenElementDimensions(e){let i={};return e.style.visibility="hidden",e.style.display="block",i.width=e.offsetWidth,i.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible",i}static scrollInView(e,i){let n=getComputedStyle(e).getPropertyValue("borderTopWidth"),s=n?parseFloat(n):0,a=getComputedStyle(e).getPropertyValue("paddingTop"),o=a?parseFloat(a):0,l=e.getBoundingClientRect(),d=i.getBoundingClientRect().top+document.body.scrollTop-(l.top+document.body.scrollTop)-s-o,u=e.scrollTop,h=e.clientHeight,p=this.getOuterHeight(i);d<0?e.scrollTop=u+d:d+p>h&&(e.scrollTop=u+d-h+p)}static fadeIn(e,i){e.style.opacity=0;let n=+new Date,s=0,a=function(){s=+e.style.opacity.replace(",",".")+(new Date().getTime()-n)/i,e.style.opacity=s,n=+new Date,+s<1&&(window.requestAnimationFrame&&requestAnimationFrame(a)||setTimeout(a,16))};a()}static fadeOut(e,i){var n=1,s=50,a=i,o=s/a;let l=setInterval(()=>{n=n-o,n<=0&&(n=0,clearInterval(l)),e.style.opacity=n},s)}static getWindowScrollTop(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}static getWindowScrollLeft(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}static matches(e,i){var n=Element.prototype,s=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||function(a){return[].indexOf.call(document.querySelectorAll(a),this)!==-1};return s.call(e,i)}static getOuterWidth(e,i){let n=e.offsetWidth;if(i){let s=getComputedStyle(e);n+=parseFloat(s.marginLeft)+parseFloat(s.marginRight)}return n}static getHorizontalPadding(e){let i=getComputedStyle(e);return parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)}static getHorizontalMargin(e){let i=getComputedStyle(e);return parseFloat(i.marginLeft)+parseFloat(i.marginRight)}static innerWidth(e){let i=e.offsetWidth,n=getComputedStyle(e);return i+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),i}static width(e){let i=e.offsetWidth,n=getComputedStyle(e);return i-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),i}static getInnerHeight(e){let i=e.offsetHeight,n=getComputedStyle(e);return i+=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),i}static getOuterHeight(e,i){let n=e.offsetHeight;if(i){let s=getComputedStyle(e);n+=parseFloat(s.marginTop)+parseFloat(s.marginBottom)}return n}static getHeight(e){let i=e.offsetHeight,n=getComputedStyle(e);return i-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),i}static getWidth(e){let i=e.offsetWidth,n=getComputedStyle(e);return i-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),i}static getViewport(){let e=window,i=document,n=i.documentElement,s=i.getElementsByTagName("body")[0],a=e.innerWidth||n.clientWidth||s.clientWidth,o=e.innerHeight||n.clientHeight||s.clientHeight;return{width:a,height:o}}static getOffset(e){var i=e.getBoundingClientRect();return{top:i.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:i.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}static replaceElementWith(e,i){let n=e.parentNode;if(!n)throw"Can't replace element";return n.replaceChild(i,e)}static getUserAgent(){if(navigator&&this.isClient())return navigator.userAgent}static isIE(){var e=window.navigator.userAgent,i=e.indexOf("MSIE ");if(i>0)return!0;var n=e.indexOf("Trident/");if(n>0){var s=e.indexOf("rv:");return!0}var a=e.indexOf("Edge/");return a>0}static isIOS(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}static isAndroid(){return/(android)/i.test(navigator.userAgent)}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}static appendChild(e,i){if(this.isElement(i))i.appendChild(e);else if(i&&i.el&&i.el.nativeElement)i.el.nativeElement.appendChild(e);else throw"Cannot append "+i+" to "+e}static removeChild(e,i){if(this.isElement(i))i.removeChild(e);else if(i.el&&i.el.nativeElement)i.el.nativeElement.removeChild(e);else throw"Cannot remove "+e+" from "+i}static removeElement(e){"remove"in Element.prototype?e.remove():e.parentNode.removeChild(e)}static isElement(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"}static calculateScrollbarWidth(e){if(e){let i=getComputedStyle(e);return e.offsetWidth-e.clientWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.borderRightWidth)}else{if(this.calculatedScrollbarWidth!==null)return this.calculatedScrollbarWidth;let i=document.createElement("div");i.className="p-scrollbar-measure",document.body.appendChild(i);let n=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),this.calculatedScrollbarWidth=n,n}}static calculateScrollbarHeight(){if(this.calculatedScrollbarHeight!==null)return this.calculatedScrollbarHeight;let e=document.createElement("div");e.className="p-scrollbar-measure",document.body.appendChild(e);let i=e.offsetHeight-e.clientHeight;return document.body.removeChild(e),this.calculatedScrollbarWidth=i,i}static invokeElementMethod(e,i,n){e[i].apply(e,n)}static clearSelection(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch{}}static getBrowser(){if(!this.browser){let e=this.resolveUserAgent();this.browser={},e.browser&&(this.browser[e.browser]=!0,this.browser.version=e.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}static resolveUserAgent(){let e=navigator.userAgent.toLowerCase(),i=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:i[1]||"",version:i[2]||"0"}}static isInteger(e){return Number.isInteger?Number.isInteger(e):typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}static isHidden(e){return!e||e.offsetParent===null}static isVisible(e){return e&&e.offsetParent!=null}static isExist(e){return e!==null&&typeof e<"u"&&e.nodeName&&e.parentNode}static focus(e,i){e&&document.activeElement!==e&&e.focus(i)}static getFocusableSelectorString(e=""){return`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, .p-inputtext:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, .p-button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`}static getFocusableElements(e,i=""){let n=this.find(e,this.getFocusableSelectorString(i)),s=[];for(let a of n){let o=getComputedStyle(a);this.isVisible(a)&&o.display!="none"&&o.visibility!="hidden"&&s.push(a)}return s}static getFocusableElement(e,i=""){let n=this.findSingle(e,this.getFocusableSelectorString(i));if(n){let s=getComputedStyle(n);if(this.isVisible(n)&&s.display!="none"&&s.visibility!="hidden")return n}return null}static getFirstFocusableElement(e,i=""){let n=this.getFocusableElements(e,i);return n.length>0?n[0]:null}static getLastFocusableElement(e,i){let n=this.getFocusableElements(e,i);return n.length>0?n[n.length-1]:null}static getNextFocusableElement(e,i=!1){let n=r.getFocusableElements(e),s=0;if(n&&n.length>0){let a=n.indexOf(n[0].ownerDocument.activeElement);i?a==-1||a===0?s=n.length-1:s=a-1:a!=-1&&a!==n.length-1&&(s=a+1)}return n[s]}static generateZIndex(){return this.zindex=this.zindex||999,++this.zindex}static getSelection(){return window.getSelection?window.getSelection().toString():document.getSelection?document.getSelection().toString():document.selection?document.selection.createRange().text:null}static getTargetElement(e,i){if(!e)return null;switch(e){case"document":return document;case"window":return window;case"@next":return i?.nextElementSibling;case"@prev":return i?.previousElementSibling;case"@parent":return i?.parentElement;case"@grandparent":return i?.parentElement.parentElement;default:let n=typeof e;if(n==="string")return document.querySelector(e);if(n==="object"&&e.hasOwnProperty("nativeElement"))return this.isExist(e.nativeElement)?e.nativeElement:void 0;let a=(o=>!!(o&&o.constructor&&o.call&&o.apply))(e)?e():e;return a&&a.nodeType===9||this.isExist(a)?a:null}}static isClient(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}static getAttribute(e,i){if(e){let n=e.getAttribute(i);return isNaN(n)?n==="true"||n==="false"?n==="true":n:+n}}static calculateBodyScrollbarWidth(){return window.innerWidth-document.documentElement.offsetWidth}static blockBodyScroll(e="p-overflow-hidden"){document.body.style.setProperty("--scrollbar-width",this.calculateBodyScrollbarWidth()+"px"),this.addClass(document.body,e)}static unblockBodyScroll(e="p-overflow-hidden"){document.body.style.removeProperty("--scrollbar-width"),this.removeClass(document.body,e)}static createElement(e,i={},...n){if(e){let s=document.createElement(e);return this.setAttributes(s,i),s.append(...n),s}}static setAttribute(e,i="",n){this.isElement(e)&&n!==null&&n!==void 0&&e.setAttribute(i,n)}static setAttributes(e,i={}){if(this.isElement(e)){let n=(s,a)=>{let o=e?.$attrs?.[s]?[e?.$attrs?.[s]]:[];return[a].flat().reduce((l,c)=>{if(c!=null){let d=typeof c;if(d==="string"||d==="number")l.push(c);else if(d==="object"){let u=Array.isArray(c)?n(s,c):Object.entries(c).map(([h,p])=>s==="style"&&(p||p===0)?`${h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${p}`:p?h:void 0);l=u.length?l.concat(u.filter(h=>!!h)):l}}return l},o)};Object.entries(i).forEach(([s,a])=>{if(a!=null){let o=s.match(/^on(.+)/);o?e.addEventListener(o[1].toLowerCase(),a):s==="pBind"?this.setAttributes(e,a):(a=s==="class"?[...new Set(n("class",a))].join(" ").trim():s==="style"?n("style",a).join(";").trim():a,(e.$attrs=e.$attrs||{})&&(e.$attrs[s]=a),e.setAttribute(s,a))}})}}static isFocusableElement(e,i=""){return this.isElement(e)?e.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i}`):!1}}return r})(),rs=class{element;listener;scrollableParents;constructor(t,e=()=>{}){this.element=t,this.listener=e}bindScrollListener(){this.scrollableParents=M.getScrollableParents(this.element);for(let t=0;t{class r{label;spin=!1;styleClass;role;ariaLabel;ariaHidden;ngOnInit(){this.getAttributes()}getAttributes(){let e=be.isEmpty(this.label);this.role=e?void 0:"img",this.ariaLabel=e?void 0:this.label,this.ariaHidden=e}getClassNames(){return`p-icon ${this.styleClass?this.styleClass+" ":""}${this.spin?"p-icon-spin":""}`}static \u0275fac=function(i){return new(i||r)};static \u0275cmp=Q({type:r,selectors:[["ng-component"]],hostAttrs:[1,"p-element","p-icon-wrapper"],inputs:{label:"label",spin:[2,"spin","spin",J],styleClass:"styleClass"},standalone:!0,features:[Be,ue],ngContentSelectors:Qm,decls:1,vars:0,template:function(i,n){i&1&&(mt(),Qe(0))},encapsulation:2,changeDetection:0})}return r})();var ss=(()=>{class r{document;platformId;renderer;el;zone;config;constructor(e,i,n,s,a,o){this.document=e,this.platformId=i,this.renderer=n,this.el=s,this.zone=a,this.config=o}animationListener;mouseDownListener;timeout;ngAfterViewInit(){at(this.platformId)&&this.config&&this.config.ripple&&this.zone.runOutsideAngular(()=>{this.create(),this.mouseDownListener=this.renderer.listen(this.el.nativeElement,"mousedown",this.onMouseDown.bind(this))})}onMouseDown(e){let i=this.getInk();if(!i||this.document.defaultView?.getComputedStyle(i,null).display==="none")return;if(M.removeClass(i,"p-ink-active"),!M.getHeight(i)&&!M.getWidth(i)){let o=Math.max(M.getOuterWidth(this.el.nativeElement),M.getOuterHeight(this.el.nativeElement));i.style.height=o+"px",i.style.width=o+"px"}let n=M.getOffset(this.el.nativeElement),s=e.pageX-n.left+this.document.body.scrollTop-M.getWidth(i)/2,a=e.pageY-n.top+this.document.body.scrollLeft-M.getHeight(i)/2;this.renderer.setStyle(i,"top",a+"px"),this.renderer.setStyle(i,"left",s+"px"),M.addClass(i,"p-ink-active"),this.timeout=setTimeout(()=>{let o=this.getInk();o&&M.removeClass(o,"p-ink-active")},401)}getInk(){let e=this.el.nativeElement.children;for(let i=0;i{class r{static \u0275fac=function(i){return new(i||r)};static \u0275mod=Ce({type:r});static \u0275inj=_e({})}return r})();var fu=(()=>{class r{autofocus=!1;focused=!1;platformId=b(ut);document=b(fe);host=b(Ie);ngAfterContentChecked(){this.autofocus===!1?this.host.nativeElement.removeAttribute("autofocus"):this.host.nativeElement.setAttribute("autofocus",!0),this.focused||this.autoFocus()}ngAfterViewChecked(){this.focused||this.autoFocus()}autoFocus(){at(this.platformId)&&this.autofocus&&setTimeout(()=>{let e=M.getFocusableElements(this.host?.nativeElement);e.length===0&&this.host.nativeElement.focus(),e.length>0&&e[0].focus(),this.focused=!0})}static \u0275fac=function(i){return new(i||r)};static \u0275dir=Se({type:r,selectors:[["","pAutoFocus",""]],hostAttrs:[1,"p-element"],inputs:{autofocus:[2,"autofocus","autofocus",J]},standalone:!0,features:[Be]})}return r})();var gu=(()=>{class r extends fi{pathId;ngOnInit(){this.pathId="url(#"+Cn()+")"}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ze(r)))(n||r)}})();static \u0275cmp=Q({type:r,selectors:[["SpinnerIcon"]],standalone:!0,features:[Xt,ue],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M6.99701 14C5.85441 13.999 4.72939 13.7186 3.72012 13.1832C2.71084 12.6478 1.84795 11.8737 1.20673 10.9284C0.565504 9.98305 0.165424 8.89526 0.041387 7.75989C-0.0826496 6.62453 0.073125 5.47607 0.495122 4.4147C0.917119 3.35333 1.59252 2.4113 2.46241 1.67077C3.33229 0.930247 4.37024 0.413729 5.4857 0.166275C6.60117 -0.0811796 7.76026 -0.0520535 8.86188 0.251112C9.9635 0.554278 10.9742 1.12227 11.8057 1.90555C11.915 2.01493 11.9764 2.16319 11.9764 2.31778C11.9764 2.47236 11.915 2.62062 11.8057 2.73C11.7521 2.78503 11.688 2.82877 11.6171 2.85864C11.5463 2.8885 11.4702 2.90389 11.3933 2.90389C11.3165 2.90389 11.2404 2.8885 11.1695 2.85864C11.0987 2.82877 11.0346 2.78503 10.9809 2.73C9.9998 1.81273 8.73246 1.26138 7.39226 1.16876C6.05206 1.07615 4.72086 1.44794 3.62279 2.22152C2.52471 2.99511 1.72683 4.12325 1.36345 5.41602C1.00008 6.70879 1.09342 8.08723 1.62775 9.31926C2.16209 10.5513 3.10478 11.5617 4.29713 12.1803C5.48947 12.7989 6.85865 12.988 8.17414 12.7157C9.48963 12.4435 10.6711 11.7264 11.5196 10.6854C12.3681 9.64432 12.8319 8.34282 12.8328 7C12.8328 6.84529 12.8943 6.69692 13.0038 6.58752C13.1132 6.47812 13.2616 6.41667 13.4164 6.41667C13.5712 6.41667 13.7196 6.47812 13.8291 6.58752C13.9385 6.69692 14 6.84529 14 7C14 8.85651 13.2622 10.637 11.9489 11.9497C10.6356 13.2625 8.85432 14 6.99701 14Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(oi(),F(0,"svg",0)(1,"g"),X(2,"path",1),O(),F(3,"defs")(4,"clipPath",2),X(5,"rect",3),O()()()),i&2&&(We(n.getClassNames()),Z("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),I(),Z("clip-path",n.pathId),I(3),v("id",n.pathId))},encapsulation:2})}return r})();var ef=["*"],_u=r=>({class:r});function tf(r,t){r&1&&Ye(0)}function nf(r,t){if(r&1&&X(0,"span",8),r&2){let e=w(3);v("ngClass",e.iconClass()),Z("aria-hidden",!0)("data-pc-section","loadingicon")}}function rf(r,t){if(r&1&&X(0,"SpinnerIcon",9),r&2){let e=w(3);v("styleClass",e.spinnerIconClass())("spin",!0),Z("aria-hidden",!0)("data-pc-section","loadingicon")}}function sf(r,t){if(r&1&&(Et(0),$(1,nf,1,3,"span",6)(2,rf,1,4,"SpinnerIcon",7),At()),r&2){let e=w(2);I(),v("ngIf",e.loadingIcon),I(),v("ngIf",!e.loadingIcon)}}function af(r,t){}function of(r,t){if(r&1&&$(0,af,0,0,"ng-template",10),r&2){let e=w(2);v("ngIf",e.loadingIconTemplate)}}function lf(r,t){if(r&1&&(Et(0),$(1,sf,3,2,"ng-container",2)(2,of,1,1,null,5),At()),r&2){let e=w();I(),v("ngIf",!e.loadingIconTemplate),I(),v("ngTemplateOutlet",e.loadingIconTemplate)("ngTemplateOutletContext",st(3,_u,e.iconClass()))}}function cf(r,t){if(r&1&&X(0,"span",8),r&2){let e=w(2);v("ngClass",e.iconClass()),Z("data-pc-section","icon")}}function df(r,t){}function uf(r,t){if(r&1&&$(0,df,0,0,"ng-template",10),r&2){let e=w(2);v("ngIf",!e.icon&&e.iconTemplate)}}function hf(r,t){if(r&1&&(Et(0),$(1,cf,1,2,"span",6)(2,uf,1,1,null,5),At()),r&2){let e=w();I(),v("ngIf",e.icon&&!e.iconTemplate),I(),v("ngTemplateOutlet",e.iconTemplate)("ngTemplateOutletContext",st(3,_u,e.iconClass()))}}function pf(r,t){if(r&1&&(F(0,"span",11),Ee(1),O()),r&2){let e=w();Z("aria-hidden",e.icon&&!e.label)("data-pc-section","label"),I(),Ei(e.label)}}function mf(r,t){if(r&1&&(F(0,"span",8),Ee(1),O()),r&2){let e=w();We(e.badgeClass),v("ngClass",e.badgeStyleClass()),Z("data-pc-section","badge"),I(),Ei(e.badge)}}var ff=(()=>{class r{el;type="button";iconPos="left";icon;badge;label;disabled;loading=!1;loadingIcon;raised=!1;rounded=!1;text=!1;plain=!1;severity;outlined=!1;link=!1;tabindex;size;style;styleClass;badgeClass;ariaLabel;autofocus;onClick=new W;onFocus=new W;onBlur=new W;contentTemplate;loadingIconTemplate;iconTemplate;templates;constructor(e){this.el=e}spinnerIconClass(){return Object.entries(this.iconClass()).filter(([,e])=>!!e).reduce((e,[i])=>e+` ${i}`,"p-button-loading-icon")}iconClass(){let e={"p-button-icon":!0,"p-button-icon-left":this.iconPos==="left"&&this.label,"p-button-icon-right":this.iconPos==="right"&&this.label,"p-button-icon-top":this.iconPos==="top"&&this.label,"p-button-icon-bottom":this.iconPos==="bottom"&&this.label};return this.loading?e[`p-button-loading-icon pi-spin ${this.loadingIcon??""}`]=!0:this.icon&&(e[this.icon]=!0),e}get buttonClass(){return{"p-button p-component":!0,"p-button-icon-only":(this.icon||this.iconTemplate||this.loadingIcon||this.loadingIconTemplate)&&!this.label,"p-button-vertical":(this.iconPos==="top"||this.iconPos==="bottom")&&this.label,"p-button-loading":this.loading,"p-button-loading-label-only":this.loading&&!this.icon&&this.label&&!this.loadingIcon&&this.iconPos==="left","p-button-link":this.link,[`p-button-${this.severity}`]:this.severity,"p-button-raised":this.raised,"p-button-rounded":this.rounded,"p-button-text":this.text,"p-button-outlined":this.outlined,"p-button-sm":this.size==="small","p-button-lg":this.size==="large","p-button-plain":this.plain,[`${this.styleClass}`]:this.styleClass}}ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"content":this.contentTemplate=e.template;break;case"icon":this.iconTemplate=e.template;break;case"loadingicon":this.loadingIconTemplate=e.template;break;default:this.contentTemplate=e.template;break}})}badgeStyleClass(){return{"p-badge p-component":!0,"p-badge-no-gutter":this.badge&&String(this.badge).length===1}}focus(){this.el.nativeElement.firstChild.focus()}static \u0275fac=function(i){return new(i||r)(S(Ie))};static \u0275cmp=Q({type:r,selectors:[["p-button"]],contentQueries:function(i,n,s){if(i&1&&rt(s,mi,4),i&2){let a;Te(a=we())&&(n.templates=a)}},hostAttrs:[1,"p-element"],hostVars:2,hostBindings:function(i,n){i&2&&Pn("p-disabled",n.disabled)},inputs:{type:"type",iconPos:"iconPos",icon:"icon",badge:"badge",label:"label",disabled:[2,"disabled","disabled",J],loading:[2,"loading","loading",J],loadingIcon:"loadingIcon",raised:[2,"raised","raised",J],rounded:[2,"rounded","rounded",J],text:[2,"text","text",J],plain:[2,"plain","plain",J],severity:"severity",outlined:[2,"outlined","outlined",J],link:[2,"link","link",J],tabindex:[2,"tabindex","tabindex",Ge],size:"size",style:"style",styleClass:"styleClass",badgeClass:"badgeClass",ariaLabel:"ariaLabel",autofocus:[2,"autofocus","autofocus",J]},outputs:{onClick:"onClick",onFocus:"onFocus",onBlur:"onBlur"},standalone:!0,features:[Be,ue],ngContentSelectors:ef,decls:7,vars:14,consts:[["pRipple","","pAutoFocus","",3,"click","focus","blur","ngStyle","disabled","ngClass","autofocus"],[4,"ngTemplateOutlet"],[4,"ngIf"],["class","p-button-label",4,"ngIf"],[3,"ngClass","class",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngClass",4,"ngIf"],[3,"styleClass","spin",4,"ngIf"],[3,"ngClass"],[3,"styleClass","spin"],[3,"ngIf"],[1,"p-button-label"]],template:function(i,n){i&1&&(mt(),F(0,"button",0),xe("click",function(a){return n.onClick.emit(a)})("focus",function(a){return n.onFocus.emit(a)})("blur",function(a){return n.onBlur.emit(a)}),Qe(1),$(2,tf,1,0,"ng-container",1)(3,lf,3,5,"ng-container",2)(4,hf,3,5,"ng-container",2)(5,pf,2,3,"span",3)(6,mf,2,5,"span",4),O()),i&2&&(v("ngStyle",n.style)("disabled",n.disabled||n.loading)("ngClass",n.buttonClass)("autofocus",n.autofocus),Z("type",n.type)("aria-label",n.ariaLabel)("data-pc-name","button")("data-pc-section","root")("tabindex",n.tabindex),I(2),v("ngTemplateOutlet",n.contentTemplate),I(),v("ngIf",n.loading),I(),v("ngIf",!n.loading),I(),v("ngIf",!n.contentTemplate&&n.label),I(),v("ngIf",!n.contentTemplate&&n.badge))},dependencies:[Ri,Yt,xi,xt,ss,fu,gu],encapsulation:2,changeDetection:0})}return r})(),Cu=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275mod=Ce({type:r});static \u0275inj=_e({imports:[ff,ti]})}return r})();var Io=(()=>{class r extends fi{static \u0275fac=(()=>{let e;return function(n){return(e||(e=ze(r)))(n||r)}})();static \u0275cmp=Q({type:r,selectors:[["AngleRightIcon"]],standalone:!0,features:[Xt,ue],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M5.25 11.1728C5.14929 11.1694 5.05033 11.1455 4.9592 11.1025C4.86806 11.0595 4.78666 10.9984 4.72 10.9228C4.57955 10.7822 4.50066 10.5916 4.50066 10.3928C4.50066 10.1941 4.57955 10.0035 4.72 9.86283L7.72 6.86283L4.72 3.86283C4.66067 3.71882 4.64765 3.55991 4.68275 3.40816C4.71785 3.25642 4.79932 3.11936 4.91585 3.01602C5.03238 2.91268 5.17819 2.84819 5.33305 2.83149C5.4879 2.81479 5.64411 2.84671 5.78 2.92283L9.28 6.42283C9.42045 6.56346 9.49934 6.75408 9.49934 6.95283C9.49934 7.15158 9.42045 7.34221 9.28 7.48283L5.78 10.9228C5.71333 10.9984 5.63193 11.0595 5.5408 11.1025C5.44966 11.1455 5.35071 11.1694 5.25 11.1728Z","fill","currentColor"]],template:function(i,n){i&1&&(oi(),F(0,"svg",0),X(1,"path",1),O()),i&2&&(We(n.getClassNames()),Z("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role))},encapsulation:2})}return r})();var vu=(()=>{class r{platformId;el;zone;config;renderer;viewContainer;tooltipPosition;tooltipEvent="hover";appendTo;positionStyle;tooltipStyleClass;tooltipZIndex;escape=!0;showDelay;hideDelay;life;positionTop;positionLeft;autoHide=!0;fitContent=!0;hideOnEscape=!0;content;get disabled(){return this._disabled}set disabled(e){this._disabled=e,this.deactivate()}tooltipOptions;_tooltipOptions={tooltipLabel:null,tooltipPosition:"right",tooltipEvent:"hover",appendTo:"body",positionStyle:null,tooltipStyleClass:null,tooltipZIndex:"auto",escape:!0,disabled:null,showDelay:null,hideDelay:null,positionTop:null,positionLeft:null,life:null,autoHide:!0,hideOnEscape:!0,id:Cn()+"_tooltip"};_disabled;container;styleClass;tooltipText;showTimeout;hideTimeout;active;mouseEnterListener;mouseLeaveListener;containerMouseleaveListener;clickListener;focusListener;blurListener;scrollHandler;resizeListener;interactionInProgress=!1;constructor(e,i,n,s,a,o){this.platformId=e,this.el=i,this.zone=n,this.config=s,this.renderer=a,this.viewContainer=o}ngAfterViewInit(){at(this.platformId)&&this.zone.runOutsideAngular(()=>{let e=this.getOption("tooltipEvent");if((e==="hover"||e==="both")&&(this.mouseEnterListener=this.onMouseEnter.bind(this),this.mouseLeaveListener=this.onMouseLeave.bind(this),this.clickListener=this.onInputClick.bind(this),this.el.nativeElement.addEventListener("mouseenter",this.mouseEnterListener),this.el.nativeElement.addEventListener("click",this.clickListener),this.el.nativeElement.addEventListener("mouseleave",this.mouseLeaveListener)),e==="focus"||e==="both"){this.focusListener=this.onFocus.bind(this),this.blurListener=this.onBlur.bind(this);let i=this.el.nativeElement.querySelector(".p-component");i||(i=this.getTarget(this.el.nativeElement)),i.addEventListener("focus",this.focusListener),i.addEventListener("blur",this.blurListener)}})}ngOnChanges(e){e.tooltipPosition&&this.setOption({tooltipPosition:e.tooltipPosition.currentValue}),e.tooltipEvent&&this.setOption({tooltipEvent:e.tooltipEvent.currentValue}),e.appendTo&&this.setOption({appendTo:e.appendTo.currentValue}),e.positionStyle&&this.setOption({positionStyle:e.positionStyle.currentValue}),e.tooltipStyleClass&&this.setOption({tooltipStyleClass:e.tooltipStyleClass.currentValue}),e.tooltipZIndex&&this.setOption({tooltipZIndex:e.tooltipZIndex.currentValue}),e.escape&&this.setOption({escape:e.escape.currentValue}),e.showDelay&&this.setOption({showDelay:e.showDelay.currentValue}),e.hideDelay&&this.setOption({hideDelay:e.hideDelay.currentValue}),e.life&&this.setOption({life:e.life.currentValue}),e.positionTop&&this.setOption({positionTop:e.positionTop.currentValue}),e.positionLeft&&this.setOption({positionLeft:e.positionLeft.currentValue}),e.disabled&&this.setOption({disabled:e.disabled.currentValue}),e.content&&(this.setOption({tooltipLabel:e.content.currentValue}),this.active&&(e.content.currentValue?this.container&&this.container.offsetParent?(this.updateText(),this.align()):this.show():this.hide())),e.autoHide&&this.setOption({autoHide:e.autoHide.currentValue}),e.id&&this.setOption({id:e.id.currentValue}),e.tooltipOptions&&(this._tooltipOptions=f(f({},this._tooltipOptions),e.tooltipOptions.currentValue),this.deactivate(),this.active&&(this.getOption("tooltipLabel")?this.container&&this.container.offsetParent?(this.updateText(),this.align()):this.show():this.hide()))}isAutoHide(){return this.getOption("autoHide")}onMouseEnter(e){!this.container&&!this.showTimeout&&this.activate()}onMouseLeave(e){this.isAutoHide()?this.deactivate():!(M.hasClass(e.relatedTarget,"p-tooltip")||M.hasClass(e.relatedTarget,"p-tooltip-text")||M.hasClass(e.relatedTarget,"p-tooltip-arrow"))&&this.deactivate()}onFocus(e){this.activate()}onBlur(e){this.deactivate()}onInputClick(e){this.deactivate()}onPressEscape(){this.hideOnEscape&&this.deactivate()}activate(){if(!this.interactionInProgress&&(this.active=!0,this.clearHideTimeout(),this.getOption("showDelay")?this.showTimeout=setTimeout(()=>{this.show()},this.getOption("showDelay")):this.show(),this.getOption("life"))){let e=this.getOption("showDelay")?this.getOption("life")+this.getOption("showDelay"):this.getOption("life");this.hideTimeout=setTimeout(()=>{this.hide()},e)}this.interactionInProgress=!0}deactivate(){this.interactionInProgress=!1,this.active=!1,this.clearShowTimeout(),this.getOption("hideDelay")?(this.clearHideTimeout(),this.hideTimeout=setTimeout(()=>{this.hide()},this.getOption("hideDelay"))):this.hide()}create(){this.container&&(this.clearHideTimeout(),this.remove()),this.container=document.createElement("div"),this.container.setAttribute("id",this.getOption("id")),this.container.setAttribute("role","tooltip");let e=document.createElement("div");e.className="p-tooltip-arrow",this.container.appendChild(e),this.tooltipText=document.createElement("div"),this.tooltipText.className="p-tooltip-text",this.updateText(),this.getOption("positionStyle")&&(this.container.style.position=this.getOption("positionStyle")),this.container.appendChild(this.tooltipText),this.getOption("appendTo")==="body"?document.body.appendChild(this.container):this.getOption("appendTo")==="target"?M.appendChild(this.container,this.el.nativeElement):M.appendChild(this.container,this.getOption("appendTo")),this.container.style.display="inline-block",this.fitContent&&(this.container.style.width="fit-content"),this.isAutoHide()?this.container.style.pointerEvents="none":(this.container.style.pointerEvents="unset",this.bindContainerMouseleaveListener())}bindContainerMouseleaveListener(){if(!this.containerMouseleaveListener){let e=this.container??this.container.nativeElement;this.containerMouseleaveListener=this.renderer.listen(e,"mouseleave",i=>{this.deactivate()})}}unbindContainerMouseleaveListener(){this.containerMouseleaveListener&&(this.bindContainerMouseleaveListener(),this.containerMouseleaveListener=null)}show(){if(!this.getOption("tooltipLabel")||this.getOption("disabled"))return;this.create(),this.el.nativeElement.closest("p-dialog")?setTimeout(()=>{this.container&&this.align()},100):this.align(),M.fadeIn(this.container,250),this.getOption("tooltipZIndex")==="auto"?Oi.set("tooltip",this.container,this.config.zIndex.tooltip):this.container.style.zIndex=this.getOption("tooltipZIndex"),this.bindDocumentResizeListener(),this.bindScrollListener()}hide(){this.getOption("tooltipZIndex")==="auto"&&Oi.clear(this.container),this.remove()}updateText(){let e=this.getOption("tooltipLabel");if(e instanceof Bt){let i=this.viewContainer.createEmbeddedView(e);i.detectChanges(),i.rootNodes.forEach(n=>this.tooltipText.appendChild(n))}else this.getOption("escape")?(this.tooltipText.innerHTML="",this.tooltipText.appendChild(document.createTextNode(e))):this.tooltipText.innerHTML=e}align(){switch(this.getOption("tooltipPosition")){case"top":this.alignTop(),this.isOutOfBounds()&&(this.alignBottom(),this.isOutOfBounds()&&(this.alignRight(),this.isOutOfBounds()&&this.alignLeft()));break;case"bottom":this.alignBottom(),this.isOutOfBounds()&&(this.alignTop(),this.isOutOfBounds()&&(this.alignRight(),this.isOutOfBounds()&&this.alignLeft()));break;case"left":this.alignLeft(),this.isOutOfBounds()&&(this.alignRight(),this.isOutOfBounds()&&(this.alignTop(),this.isOutOfBounds()&&this.alignBottom()));break;case"right":this.alignRight(),this.isOutOfBounds()&&(this.alignLeft(),this.isOutOfBounds()&&(this.alignTop(),this.isOutOfBounds()&&this.alignBottom()));break}}getHostOffset(){if(this.getOption("appendTo")==="body"||this.getOption("appendTo")==="target"){let e=this.el.nativeElement.getBoundingClientRect(),i=e.left+M.getWindowScrollLeft(),n=e.top+M.getWindowScrollTop();return{left:i,top:n}}else return{left:0,top:0}}alignRight(){this.preAlign("right");let e=this.activeElement,i=this.getHostOffset(),n=i.left+M.getOuterWidth(e),s=i.top+(M.getOuterHeight(e)-M.getOuterHeight(this.container))/2;this.container.style.left=n+this.getOption("positionLeft")+"px",this.container.style.top=s+this.getOption("positionTop")+"px"}get activeElement(){return this.el.nativeElement.nodeName.includes("P-")?M.findSingle(this.el.nativeElement,".p-component")||this.el.nativeElement:this.el.nativeElement}alignLeft(){this.preAlign("left");let e=this.getHostOffset(),i=e.left-M.getOuterWidth(this.container),n=e.top+(M.getOuterHeight(this.el.nativeElement)-M.getOuterHeight(this.container))/2;this.container.style.left=i+this.getOption("positionLeft")+"px",this.container.style.top=n+this.getOption("positionTop")+"px"}alignTop(){this.preAlign("top");let e=this.getHostOffset(),i=e.left+(M.getOuterWidth(this.el.nativeElement)-M.getOuterWidth(this.container))/2,n=e.top-M.getOuterHeight(this.container);this.container.style.left=i+this.getOption("positionLeft")+"px",this.container.style.top=n+this.getOption("positionTop")+"px"}alignBottom(){this.preAlign("bottom");let e=this.getHostOffset(),i=e.left+(M.getOuterWidth(this.el.nativeElement)-M.getOuterWidth(this.container))/2,n=e.top+M.getOuterHeight(this.el.nativeElement);this.container.style.left=i+this.getOption("positionLeft")+"px",this.container.style.top=n+this.getOption("positionTop")+"px"}setOption(e){this._tooltipOptions=f(f({},this._tooltipOptions),e)}getOption(e){return this._tooltipOptions[e]}getTarget(e){return M.hasClass(e,"p-inputwrapper")?M.findSingle(e,"input"):e}preAlign(e){this.container.style.left="-999px",this.container.style.top="-999px";let i="p-tooltip p-component p-tooltip-"+e;this.container.className=this.getOption("tooltipStyleClass")?i+" "+this.getOption("tooltipStyleClass"):i}isOutOfBounds(){let e=this.container.getBoundingClientRect(),i=e.top,n=e.left,s=M.getOuterWidth(this.container),a=M.getOuterHeight(this.container),o=M.getViewport();return n+s>o.width||n<0||i<0||i+a>o.height}onWindowResize(e){this.hide()}bindDocumentResizeListener(){this.zone.runOutsideAngular(()=>{this.resizeListener=this.onWindowResize.bind(this),window.addEventListener("resize",this.resizeListener)})}unbindDocumentResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}bindScrollListener(){this.scrollHandler||(this.scrollHandler=new rs(this.el.nativeElement,()=>{this.container&&this.hide()})),this.scrollHandler.bindScrollListener()}unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}unbindEvents(){let e=this.getOption("tooltipEvent");if((e==="hover"||e==="both")&&(this.el.nativeElement.removeEventListener("mouseenter",this.mouseEnterListener),this.el.nativeElement.removeEventListener("mouseleave",this.mouseLeaveListener),this.el.nativeElement.removeEventListener("click",this.clickListener)),e==="focus"||e==="both"){let i=this.el.nativeElement.querySelector(".p-component");i||(i=this.getTarget(this.el.nativeElement))}this.unbindDocumentResizeListener()}remove(){this.container&&this.container.parentElement&&(this.getOption("appendTo")==="body"?document.body.removeChild(this.container):this.getOption("appendTo")==="target"?this.el.nativeElement.removeChild(this.container):M.removeChild(this.container,this.getOption("appendTo"))),this.unbindDocumentResizeListener(),this.unbindScrollListener(),this.unbindContainerMouseleaveListener(),this.clearTimeouts(),this.container=null,this.scrollHandler=null}clearShowTimeout(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null)}clearHideTimeout(){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout()}ngOnDestroy(){this.unbindEvents(),this.container&&Oi.clear(this.container),this.remove(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null)}static \u0275fac=function(i){return new(i||r)(S(ut),S(Ie),S(Re),S(vn),S(ht),S(wi))};static \u0275dir=Se({type:r,selectors:[["","pTooltip",""]],hostAttrs:[1,"p-element"],hostBindings:function(i,n){i&1&&xe("keydown.escape",function(a){return n.onPressEscape(a)},!1,wr)},inputs:{tooltipPosition:"tooltipPosition",tooltipEvent:"tooltipEvent",appendTo:"appendTo",positionStyle:"positionStyle",tooltipStyleClass:"tooltipStyleClass",tooltipZIndex:"tooltipZIndex",escape:[2,"escape","escape",J],showDelay:[2,"showDelay","showDelay",Ge],hideDelay:[2,"hideDelay","hideDelay",Ge],life:[2,"life","life",Ge],positionTop:[2,"positionTop","positionTop",Ge],positionLeft:[2,"positionLeft","positionLeft",Ge],autoHide:[2,"autoHide","autoHide",J],fitContent:[2,"fitContent","fitContent",J],hideOnEscape:[2,"hideOnEscape","hideOnEscape",J],content:[0,"pTooltip","content"],disabled:[0,"tooltipDisabled","disabled"],tooltipOptions:"tooltipOptions"},features:[Be,nt]})}return r})(),To=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275mod=Ce({type:r});static \u0275inj=_e({imports:[Xi]})}return r})();var wo=(()=>{class r extends fi{static \u0275fac=(()=>{let e;return function(n){return(e||(e=ze(r)))(n||r)}})();static \u0275cmp=Q({type:r,selectors:[["AngleDownIcon"]],standalone:!0,features:[Xt,ue],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M3.58659 4.5007C3.68513 4.50023 3.78277 4.51945 3.87379 4.55723C3.9648 4.59501 4.04735 4.65058 4.11659 4.7207L7.11659 7.7207L10.1166 4.7207C10.2619 4.65055 10.4259 4.62911 10.5843 4.65956C10.7427 4.69002 10.8871 4.77074 10.996 4.88976C11.1049 5.00877 11.1726 5.15973 11.1889 5.32022C11.2052 5.48072 11.1693 5.6422 11.0866 5.7807L7.58659 9.2807C7.44597 9.42115 7.25534 9.50004 7.05659 9.50004C6.85784 9.50004 6.66722 9.42115 6.52659 9.2807L3.02659 5.7807C2.88614 5.64007 2.80725 5.44945 2.80725 5.2507C2.80725 5.05195 2.88614 4.86132 3.02659 4.7207C3.09932 4.64685 3.18675 4.58911 3.28322 4.55121C3.37969 4.51331 3.48305 4.4961 3.58659 4.5007Z","fill","currentColor"]],template:function(i,n){i&1&&(oi(),F(0,"svg",0),X(1,"path",1),O()),i&2&&(We(n.getClassNames()),Z("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role))},encapsulation:2})}return r})();var Pt=class{static get supportNavigationLanguage(){try{return this.languageList.find(t=>navigator.language===pc[t])??"en"}catch(t){return console.warn("'navigator' object not available",`Error:${t}`),"en"}}static getCurrentStoredLanguage(t){let e=JSON.parse(ne.getString(t));return e?.language?e.language:this.supportNavigationLanguage}static get languageList(){return ft.convertEnumToArray(Sa)}};var gi=class r{constructor(){this._settingsService=b(He);this._router=b(tt);this._environment=b(Dt);this._language="en";let t=Pt.getCurrentStoredLanguage("configApp");this._language=t??"en";let e=this._settingsService.getConfig("language");Dr(()=>this._language=e()??"en")}navigate(t,e={}){return this._router.navigate([`/${this._language}${t}`],e)}windowNavigate(t,e,i){window.open(`${this._environment.app_scope}/${this._language}${t}`,e,i)}reloadRoute(t,e={}){let i=f({},e);this.navigate(t,i).then()}getCurrentScrollTopPosition(t){let e=document.querySelector(t);if(e){let i=e.scrollTop;return{state:{scrollTop:`${t}:${i}`}}}return null}restorePreviousScrollPosition(t){let e=t?.extras.state?.scrollTop||null;e&&setTimeout(()=>{let i=e.indexOf(":"),n=e.slice(0,i),s=Number.parseInt(e.slice(i+1),10),a=document.querySelector(n);a&&(a.scrollTop=Number.isNaN(s)?0:s)},2e3)}setLanguageToURL(t){return`${this._environment.app_scope}/${this._language}${t}`}setLanguageToFullURL(t){return`${this._environment.appUrl}/${this._language}${t}`}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var Mi={generalMetaTag:{title:"name='title'",type:"name='type'",image:"name='image'",url:"name='url'",description:"name='description'",siteName:"property='og:site_name'",showLarge:"name='twitter:card'",altCard:"name='twitter:image:alt'",fbAppId:"property='fb:app_id'",twtAppId:"name='twitter:site'",robots:"name='robots'"},facebook:{title:"property='og:title'",description:"property='og:description'",url:"property='og:url'",image:"property='og:image'",altImg:"property='og:image:alt'",height:"property='og:image:height'",width:"property='og:image:width'"},linkedin:{title:"property='og:title'",type:"property='og:type'",image:"property='og:image'",description:"property='og:description'",author:"name='author'"},twitter:{title:"name='twitter:title'",description:"name='twitter:description'",image:"name='twitter:image'",altImage:"name='twitter:image:alt'",site:"name='twitter:site'",card:"name='twitter:creator'",creator:"name='twitter:card'",url:"name='twitter:url'"},discord:{title:"property='og:title'",siteName:"property='og:site_name'",description:"property='og:description'",image:"property='og:image'",themeColor:"name='theme-color'",card:"name='twitter:card'"},telegram:{title:"property='og:title'",siteName:"property='og:site_name'",description:"property='og:description'",image:"property='og:image'"}};var as=class r{constructor(){this._document=b(fe);this._platformId=b(ut);this._appIsVisible$=new te(!this._document.hidden);this._appIsOnline$=new te(at(this._platformId)?navigator.onLine:!0);this._initialize()}_initialize(){li({read:()=>{Tt(window,"online").subscribe(()=>{this._appIsOnline$.next(!0)}),Tt(window,"offline").subscribe(()=>{this._appIsOnline$.next(!1)}),Tt(this._document,"visibilitychange").subscribe(()=>{this._appIsVisible$.next(!this._document.hidden)})}})}isAppOnlineAndVisible$(){return $t([this._appIsOnline$,this._appIsVisible$]).pipe(Si((t,e)=>t[0]===e[0]&&t[1]===e[1]),me(([t,e])=>t&&e),R(([t,e])=>t&&e))}get appIsVisible(){return this._appIsVisible$.value}get appIsOnline(){return this._appIsOnline$.value}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var os=class r{loadCss(t,e,i){let n=t.querySelectorAll("head")[0],s=t.querySelector(`#${e}`);if(s){let a=new URL(s.href);new RegExp(`${i}$`).test(a.pathname)||(s.href=i)}else{let a=t.createElement("link");a.id=e,a.rel="stylesheet",a.href=i,n.append(a)}}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var ls="og:description",Eo="twitter:card",Ao="og:site_name",bu=!0,cs=class r{constructor(){this._titleService=b(Lr);this._metaService=b(lc);this._environment=b(Dt);this._document=b(fe);this._titleVersion=` | ${this._environment.appTitle}`}setTitle(t){let e=t+this._titleVersion;this._titleService.setTitle(e)}setCanonical(t){let e=this._document.head,i=this._document.querySelector("link[rel='canonical']")??this._document.createElement("link");i.setAttribute("rel","canonical"),i.setAttribute("href",t),e.appendChild(i)}setGeneralMetaTags(t){let e=[];t.title&&(this.removeGeneralMetaTag("title"),e.push({name:"title",content:t.title+this._titleVersion})),t.type&&(this.removeGeneralMetaTag("type"),e.push({name:"type",content:t.type})),t.image&&(this.removeGeneralMetaTag("image"),e.push({name:"image",content:t.image})),t.url&&(this.removeGeneralMetaTag("url"),e.push({name:"url",content:t.url})),t.appUrl&&(this.removeGeneralMetaTag("url"),e.push({name:"url",content:`${this._environment.appUrl}/${t.appUrl}`})),t.showLarge&&(this.removeGeneralMetaTag("showLarge"),e.push({name:Eo,content:t.showLarge})),t.description&&(this.removeGeneralMetaTag("description"),e.push({name:"description",content:t.description})),t.siteName&&(this.removeGeneralMetaTag("siteName"),e.push({property:Ao,content:t.siteName})),t.altCard&&(this.removeGeneralMetaTag("altCard"),e.push({name:"twitter:image:alt",content:t.altCard})),t.fbAppId&&(this.removeGeneralMetaTag("fbAppId"),e.push({property:"fb:app_id",content:t.fbAppId})),t.twtAppId&&(this.removeGeneralMetaTag("twtAppId"),e.push({name:"twitter:site",content:t.twtAppId})),t.robots&&(this.removeGeneralMetaTag("robots"),e.push({name:"robots",content:bu?t.robots:"noindex, nofollow"})),e.length>0&&this._metaService.addTags(e,!1)}setFacebookTags(t){let e=[];t.title&&(this.removeFacebookTag("title"),e.push({property:"og:title",content:t.title+this._titleVersion})),t.description&&(this.removeFacebookTag("description"),e.push({property:ls,content:t.description})),t.url&&(this.removeFacebookTag("url"),e.push({property:"og:url",content:t.url})),t.appUrl&&(this.removeFacebookTag("url"),e.push({property:"og:url",content:`${this._environment.appUrl}/${t.appUrl}`})),t.image&&(this.removeFacebookTag("altImg"),e.push({property:"og:image",content:t.image})),t.altImage&&(this.removeFacebookTag("altImg"),e.push({property:"og:image:alt",content:t.altImage})),t.height&&(this.removeFacebookTag("width"),e.push({property:"og:image:height",content:t.height})),t.width&&(this.removeFacebookTag("width"),e.push({property:"og:image:width",content:t.width})),e.length>0&&this._metaService.addTags(e,!1)}setLinkedinTags(t){let e=[];t.title&&(this.removeLinkedinTag("title"),e.push({property:"og:title",content:t.title+this._titleVersion})),t.type&&(this.removeLinkedinTag("type"),e.push({property:"og:type",content:t.type})),t.image&&(this.removeLinkedinTag("image"),e.push({property:"og:image",content:t.image})),t.description&&(this.removeLinkedinTag("description"),e.push({property:ls,content:t.description})),t.author&&(this.removeLinkedinTag("author"),e.push({name:"author",content:t.author})),e.length>0&&this._metaService.addTags(e,!1)}setTwitterTags(t){let e=[];t.title&&(this._removeMetaTag("name='twitter:title'"),e.push({name:"twitter:title",content:t.title+this._titleVersion})),t.description&&(this._removeMetaTag("name='twitter:description'"),e.push({name:"twitter:description",content:t.description})),t.image&&(this._removeMetaTag("name='twitter:image'"),e.push({name:"twitter:image",content:t.image})),t.altImage&&(this._removeMetaTag("name='twitter:image:alt'"),e.push({name:"twitter:image:alt",content:t.altImage})),t.site&&(this._removeMetaTag("name='twitter:site'"),e.push({name:"twitter:site",content:t.site})),t.creator&&(this._removeMetaTag("name='twitter:creator'"),e.push({name:"twitter:creator",content:t.creator})),t.card&&(this._removeMetaTag("name='twitter:card'"),e.push({name:Eo,content:t.card})),t.url&&(this._removeMetaTag("name='twitter:url"),e.push({name:"twitter:url",content:t.url})),t.appUrl&&(this._removeMetaTag("name='twitter:url"),e.push({name:"twitter:url",content:`${this._environment.appUrl}/${t.appUrl}`})),e.length>0&&this._metaService.addTags(e,!1)}setDiscordTags(t){let e=[];t.title&&(this.removeDiscordTag("title"),e.push({property:"og:title",content:t.title+this._titleVersion})),t.siteName&&(this.removeDiscordTag("siteName"),e.push({property:Ao,content:t.siteName})),t.description&&(this.removeDiscordTag("description"),e.push({property:ls,content:t.description})),t.image&&(this.removeDiscordTag("image"),e.push({property:"og:image",content:t.image})),t.themeColor&&(this.removeDiscordTag("themeColor"),e.push({name:"theme-color",content:t.themeColor})),t.card&&(this.removeDiscordTag("card"),e.push({name:Eo,content:t.card})),e.length>0&&this._metaService.addTags(e,!1)}setTelegramTags(t){let e=[];t.title&&(this.removeTelegramTag("title"),e.push({property:"og:title",content:t.title+this._titleVersion})),t.siteName&&(this.removeTelegramTag("siteName"),e.push({property:Ao,content:t.siteName})),t.description&&(this.removeTelegramTag("description"),e.push({property:ls,content:t.description})),t.image&&(this.removeTelegramTag("image"),e.push({property:"og:image",content:t.image})),e.length>0&&this._metaService.addTags(e,!1)}_removeMetaTag(t){this._metaService.removeTag(t)}removeGeneralMetaTag(t){t==="robots"&&!bu||this._removeMetaTag(Mi.generalMetaTag[t])}removeFacebookTag(t){this._removeMetaTag(Mi.facebook[t])}removeLinkedinTag(t){this._removeMetaTag(Mi.linkedin[t])}removeTwitterTag(t){this._removeMetaTag(Mi.twitter[t])}removeDiscordTag(t){this._removeMetaTag(Mi.discord[t])}removeTelegramTag(t){this._removeMetaTag(Mi.telegram[t])}setSeoPage(t,e,i){if(this.setTitle(t),e&&i){let n={title:t,description:e},s={title:t,description:e,appUrl:i},a={title:t,description:e,appUrl:i};this.setGeneralMetaTags(n),this.setFacebookTags(s),this.setTwitterTags(a),this.setCanonical(i)}}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};function yu(r,t){let e=b(_t).snapshot;switch(t.type){case"params":return e.params[r];case"data":return e.data[r];case"routeConfig":return e.routeConfig&&e.routeConfig[r];case"queryParams":return e.queryParams[r];case"queryParamMap":return e.queryParamMap.get(r)}}function Su(r,t=0){return _f(r)?Number(r):arguments.length===2?t:0}function _f(r){return!isNaN(parseFloat(r))&&!isNaN(Number(r))}function ds(r){return Array.isArray(r)?r:[r]}function _i(r){return r instanceof Ie?r.nativeElement:r}var xo;try{xo=typeof Intl<"u"&&Intl.v8BreakIterator}catch{xo=!1}var bn=(()=>{class r{constructor(e){this._platformId=e,this.isBrowser=this._platformId?at(this._platformId):typeof document=="object"&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!!(window.chrome||xo)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}static{this.\u0275fac=function(i){return new(i||r)(D(ut))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),Iu=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275mod=Ce({type:r})}static{this.\u0275inj=_e({})}}return r})();var sr;function Cf(){if(sr==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>sr=!0}))}finally{sr=sr||!1}return sr}function ar(r){return Cf()?r:!!r.capture}var Ro;function vf(){if(Ro==null){let r=typeof document<"u"?document.head:null;Ro=!!(r&&(r.createShadowRoot||r.attachShadow))}return Ro}function us(r){if(vf()){let t=r.getRootNode?r.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&t instanceof ShadowRoot)return t}return null}function or(r){return r.composedPath?r.composedPath()[0]:r.target}var bf=new ae("cdk-dir-doc",{providedIn:"root",factory:yf});function yf(){return b(fe)}var Sf=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function If(r){let t=r?.toLowerCase()||"";return t==="auto"&&typeof navigator<"u"&&navigator?.language?Sf.test(navigator.language)?"rtl":"ltr":t==="rtl"?"rtl":"ltr"}var Tu=(()=>{class r{constructor(e){if(this.value="ltr",this.change=new W,e){let i=e.body?e.body.dir:null,n=e.documentElement?e.documentElement.dir:null;this.value=If(i||n||"ltr")}}ngOnDestroy(){this.change.complete()}static{this.\u0275fac=function(i){return new(i||r)(D(bf,8))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var wf=20,wu=(()=>{class r{constructor(e,i,n){this._platform=e,this._change=new B,this._changeListener=s=>{this._change.next(s)},this._document=n,i.runOutsideAngular(()=>{if(e.isBrowser){let s=this._getWindow();s.addEventListener("resize",this._changeListener),s.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){let e=this._getWindow();e.removeEventListener("resize",this._changeListener),e.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:i,height:n}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+n,right:e.left+i,height:n,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,i=this._getWindow(),n=e.documentElement,s=n.getBoundingClientRect(),a=-s.top||e.body.scrollTop||i.scrollY||n.scrollTop||0,o=-s.left||e.body.scrollLeft||i.scrollX||n.scrollLeft||0;return{top:a,left:o}}change(e=wf){return e>0?this._change.pipe(wl(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static{this.\u0275fac=function(i){return new(i||r)(D(bn),D(Re),D(fe,8))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Eu=new Set,Ni,Af=(()=>{class r{constructor(e,i){this._platform=e,this._nonce=i,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):xf}matchMedia(e){return(this._platform.WEBKIT||this._platform.BLINK)&&Rf(e,this._nonce),this._matchMedia(e)}static{this.\u0275fac=function(i){return new(i||r)(D(bn),D($l,8))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function Rf(r,t){if(!Eu.has(r))try{Ni||(Ni=document.createElement("style"),t&&Ni.setAttribute("nonce",t),Ni.setAttribute("type","text/css"),document.head.appendChild(Ni)),Ni.sheet&&(Ni.sheet.insertRule(`@media ${r} {body{ }}`,0),Eu.add(r))}catch(e){console.error(e)}}function xf(r){return{matches:r==="all"||r==="",media:r,addListener:()=>{},removeListener:()=>{}}}var Ru=(()=>{class r{constructor(e,i){this._mediaMatcher=e,this._zone=i,this._queries=new Map,this._destroySubject=new B}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(e){return Au(ds(e)).some(n=>this._registerQuery(n).mql.matches)}observe(e){let n=Au(ds(e)).map(a=>this._registerQuery(a).observable),s=$t(n);return s=yi(s.pipe(ie(1)),s.pipe(xl(1),zi(0))),s.pipe(R(a=>{let o={matches:!1,breakpoints:{}};return a.forEach(({matches:l,query:c})=>{o.matches=o.matches||l,o.breakpoints[c]=l}),o}))}_registerQuery(e){if(this._queries.has(e))return this._queries.get(e);let i=this._mediaMatcher.matchMedia(e),s={observable:new Hi(a=>{let o=l=>this._zone.run(()=>a.next(l));return i.addListener(o),()=>{i.removeListener(o)}}).pipe(Ii(i),R(({matches:a})=>({query:e,matches:a})),Ue(this._destroySubject)),mql:i};return this._queries.set(e,s),s}static{this.\u0275fac=function(i){return new(i||r)(D(Af),D(Re))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function Au(r){return r.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}function xu(r){return r.buttons===0||r.detail===0}function Du(r){let t=r.touches&&r.touches[0]||r.changedTouches&&r.changedTouches[0];return!!t&&t.identifier===-1&&(t.radiusX==null||t.radiusX===1)&&(t.radiusY==null||t.radiusY===1)}function Ku(r){let t=r.cloneNode(!0),e=t.querySelectorAll("[id]"),i=r.nodeName.toLowerCase();t.removeAttribute("id");for(let n=0;n=i&&e<=n&&t>=s&&t<=a}function cr(r,t,e){r.top+=t,r.bottom=r.top+r.height,r.left+=e,r.right=r.left+r.width}function Ou(r,t,e,i){let{top:n,right:s,bottom:a,left:o,width:l,height:c}=r,d=l*t,u=c*t;return i>n-u&&io-d&&e{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Fo(e)})})}handleScroll(t){let e=or(t),i=this.positions.get(e);if(!i)return null;let n=i.scrollPosition,s,a;if(e===this._document){let c=this.getViewportScrollPosition();s=c.top,a=c.left}else s=e.scrollTop,a=e.scrollLeft;let o=n.top-s,l=n.left-a;return this.positions.forEach((c,d)=>{c.clientRect&&e!==d&&e.contains(d)&&cr(c.clientRect,o,l)}),n.top=s,n.left=a,{top:o,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function qu(r,t){let e=r.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(n=>i.appendChild(n)),i}function Vo(r,t,e){for(let i in t)if(t.hasOwnProperty(i)){let n=t[i];n?r.setProperty(i,n,e?.has(i)?"important":""):r.removeProperty(i)}return r}function yn(r,t){let e=t?"":"none";Vo(r.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function Mu(r,t,e){Vo(r.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function gs(r,t){return t&&t!="none"?r+" "+t:r}function Nu(r,t){r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.style.transform=_s(t.left,t.top)}function _s(r,t){return`translate3d(${Math.round(r)}px, ${Math.round(t)}px, 0)`}function Fu(r){let t=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*t}function kf(r){let t=getComputedStyle(r),e=Lo(t,"transition-property"),i=e.find(o=>o==="transform"||o==="all");if(!i)return 0;let n=e.indexOf(i),s=Lo(t,"transition-duration"),a=Lo(t,"transition-delay");return Fu(s[n])+Fu(a[n])}function Lo(r,t){return r.getPropertyValue(t).split(",").map(i=>i.trim())}var Pf=new Set(["position"]),Po=class{get element(){return this._preview}constructor(t,e,i,n,s,a,o,l,c){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=n,this._previewTemplate=s,this._previewClass=a,this._pickupPositionOnPage=o,this._initialTransform=l,this._zIndex=c}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Vu(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return kf(this._preview)}addEventListener(t,e){this._preview.addEventListener(t,e)}removeEventListener(t,e){this._preview.removeEventListener(t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,n;if(i&&t){let s=t.matchSize?this._initialDomRect:null,a=t.viewContainer.createEmbeddedView(i,t.context);a.detectChanges(),n=qu(a,this._document),this._previewEmbeddedView=a,t.matchSize?Nu(n,s):n.style.transform=_s(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else n=Ku(this._rootElement),Nu(n,this._initialDomRect),this._initialTransform&&(n.style.transform=this._initialTransform);return Vo(n.style,{"pointer-events":"none",margin:Vu(n)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},Pf),yn(n,!1),n.classList.add("cdk-drag-preview"),n.setAttribute("popover","manual"),n.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(s=>n.classList.add(s)):n.classList.add(e)),n}};function Vu(r){return"showPopover"in r}var $u=ar({passive:!0}),hs=ar({passive:!1}),Uu=ar({passive:!1,capture:!0}),Of=800,Bu=new Set(["position"]),Oo=class{get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>yn(e,t)))}constructor(t,e,i,n,s,a){this._config=e,this._document=i,this._ngZone=n,this._viewportRuler=s,this._dragDropRegistry=a,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._hasStartedDragging=Me(!1),this._moveEvents=new B,this._pointerMoveSubscription=qt.EMPTY,this._pointerUpSubscription=qt.EMPTY,this._scrollSubscription=qt.EMPTY,this._resizeSubscription=qt.EMPTY,this._boundaryElement=null,this._nativeInteractionsEnabled=!0,this._handles=[],this._disabledHandles=new Set,this._direction="ltr",this.dragStartDelay=0,this.scale=1,this._disabled=!1,this.beforeStarted=new B,this.started=new B,this.released=new B,this.ended=new B,this.entered=new B,this.exited=new B,this.dropped=new B,this.moved=this._moveEvents,this._pointerDown=o=>{if(this.beforeStarted.next(),this._handles.length){let l=this._getTargetHandle(o);l&&!this._disabledHandles.has(l)&&!this.disabled&&this._initializeDragSequence(l,o)}else this.disabled||this._initializeDragSequence(this._rootElement,o)},this._pointerMove=o=>{let l=this._getPointerPositionOnPage(o);if(!this._hasStartedDragging()){let d=Math.abs(l.x-this._pickupPositionOnPage.x),u=Math.abs(l.y-this._pickupPositionOnPage.y);if(d+u>=this._config.dragStartThreshold){let p=Date.now()>=this._dragStartTime+this._getDragStartDelay(o),m=this._dropContainer;if(!p){this._endDragSequence(o);return}(!m||!m.isDragging()&&!m.isReceiving())&&(o.cancelable&&o.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(o)))}return}o.cancelable&&o.preventDefault();let c=this._getConstrainedPointerPosition(l);if(this._hasMoved=!0,this._lastKnownPointerPosition=l,this._updatePointerDirectionDelta(c),this._dropContainer)this._updateActiveDropContainer(c,l);else{let d=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,u=this._activeTransform;u.x=c.x-d.x+this._passiveTransform.x,u.y=c.y-d.y+this._passiveTransform.y,this._applyRootElementTransform(u.x,u.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:c,event:o,distance:this._getDragDistance(c),delta:this._pointerDirectionDelta})})},this._pointerUp=o=>{this._endDragSequence(o)},this._nativeDragStart=o=>{if(this._handles.length){let l=this._getTargetHandle(o);l&&!this._disabledHandles.has(l)&&!this.disabled&&o.preventDefault()}else this.disabled||o.preventDefault()},this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new fs(i),a.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>_i(i)),this._handles.forEach(i=>yn(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=_i(t);return e!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{e.addEventListener("mousedown",this._pointerDown,hs),e.addEventListener("touchstart",this._pointerDown,$u),e.addEventListener("dragstart",this._nativeDragStart,hs)}),this._initialTransform=void 0,this._rootElement=e),typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?_i(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&this._rootElement?.remove(),this._anchor?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),yn(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),yn(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._getShadowRoot()?.removeEventListener("selectstart",ju,Uu)}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){lr(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{e.addEventListener("selectstart",ju,Uu)}),i){let n=this._rootElement,s=n.parentNode,a=this._placeholder=this._createPlaceholderElement(),o=this._anchor=this._anchor||this._document.createComment("");s.insertBefore(o,n),this._initialTransform=n.style.transform||"",this._preview=new Po(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3),this._preview.attach(this._getPreviewInsertionPoint(s,e)),Mu(n,!1,Bu),this._document.body.appendChild(s.replaceChild(a,n)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),n=lr(e),s=!n&&e.button!==0,a=this._rootElement,o=or(e),l=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+Of>Date.now(),c=n?Du(e):xu(e);if(o&&o.draggable&&e.type==="mousedown"&&e.preventDefault(),i||s||l||c)return;if(this._handles.length){let h=a.style;this._rootElementTapHighlight=h.webkitTapHighlightColor||"",h.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(h=>this._updateOnScroll(h)),this._boundaryElement&&(this._boundaryRect=Fo(this._boundaryElement));let d=this._previewTemplate;this._pickupPositionInElement=d&&d.template&&!d.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let u=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:u.x,y:u.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){Mu(this._rootElement,!0,Bu),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),n=this._getPointerPositionOnPage(t),s=this._getDragDistance(n),a=e._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:s,dropPoint:n,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:a,distance:s,dropPoint:n,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,a,s,n,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:n}){let s=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!s&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(s=this._initialContainer),s&&s!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=s,this._dropContainer.enter(this,t,e,s===this._initialContainer&&s.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:s,currentIndex:s.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,n),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let n=a=>{(!a||this._preview&&or(a)===this._preview.element&&a.propertyName==="transform")&&(this._preview?.removeEventListener("transitionend",n),i(),clearTimeout(s))},s=setTimeout(n,e*1.5);this._preview.addEventListener("transitionend",n)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=qu(this._placeholderRef,this._document)):i=Ku(this._rootElement),i.style.pointerEvents="none",i.classList.add("cdk-drag-placeholder"),i}_getPointerPositionInElement(t,e,i){let n=e===this._rootElement?null:e,s=n?n.getBoundingClientRect():t,a=lr(i)?i.targetTouches[0]:i,o=this._getViewportScrollPosition(),l=a.pageX-s.left-o.left,c=a.pageY-s.top-o.top;return{x:s.left-t.left+l,y:s.top-t.top+c}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=lr(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,n=i.pageX-e.left,s=i.pageY-e.top;if(this._ownerSVGElement){let a=this._ownerSVGElement.getScreenCTM();if(a){let o=this._ownerSVGElement.createSVGPoint();return o.x=n,o.y=s,o.matrixTransform(a.inverse())}}return{x:n,y:s}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:n}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?n=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:s,y:a}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,o=this._boundaryRect,{width:l,height:c}=this._getPreviewRect(),d=o.top+a,u=o.bottom-(c-a),h=o.left+s,p=o.right-(l-s);i=Hu(i,h,p),n=Hu(n,d,u)}return{x:i,y:n}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,n=this._pointerDirectionDelta,s=this._pointerPositionAtLastDirectionChange,a=Math.abs(e-s.x),o=Math.abs(i-s.y);return a>this._config.pointerDirectionChangeThreshold&&(n.x=e>s.x?1:-1,s.x=e),o>this._config.pointerDirectionChangeThreshold&&(n.y=i>s.y?1:-1,s.y=i),n}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,yn(this._rootElement,t))}_removeRootElementListeners(t){t.removeEventListener("mousedown",this._pointerDown,hs),t.removeEventListener("touchstart",this._pointerDown,$u),t.removeEventListener("dragstart",this._nativeDragStart,hs)}_applyRootElementTransform(t,e){let i=1/this.scale,n=_s(t*i,e*i),s=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=s.transform&&s.transform!="none"?s.transform:""),s.transform=gs(n,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,n=_s(t,e);this._preview.setTransform(gs(n,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),n=this._boundaryElement.getBoundingClientRect();if(n.width===0&&n.height===0||i.width===0&&i.height===0)return;let s=n.left-i.left,a=i.right-n.right,o=n.top-i.top,l=i.bottom-n.bottom;n.width>i.width?(s>0&&(t+=s),a>0&&(t-=a)):t=0,n.height>i.height?(o>0&&(e+=o),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:lr(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=or(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&cr(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=us(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let n=this._document;return e||n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body}return _i(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}};function Hu(r,t,e){return Math.max(t,Math.min(e,r))}function lr(r){return r.type[0]==="t"}function ju(r){r.preventDefault()}function Zu(r,t,e){let i=zu(t,r.length-1),n=zu(e,r.length-1);if(i===n)return;let s=r[i],a=n0)return null;let o=this.orientation==="horizontal",l=s.findIndex(_=>_.drag===t),c=s[a],d=s[l].clientRect,u=c.clientRect,h=l>a?1:-1,p=this._getItemOffsetPx(d,u,h),m=this._getSiblingOffsetPx(l,s,h),A=s.slice();return Zu(s,l,a),s.forEach((_,x)=>{if(A[x]===_)return;let k=_.drag===t,U=k?p:m,Y=k?t.getPlaceholderElement():_.drag.getRootElement();_.offset+=U;let oe=Math.round(_.offset*(1/_.drag.scale));o?(Y.style.transform=gs(`translate3d(${oe}px, 0, 0)`,_.initialTransform),cr(_.clientRect,0,U)):(Y.style.transform=gs(`translate3d(0, ${oe}px, 0)`,_.initialTransform),cr(_.clientRect,U,0))}),this._previousSwap.overlaps=ko(u,e,i),this._previousSwap.drag=c.drag,this._previousSwap.delta=o?n.x:n.y,{previousIndex:l,currentIndex:a}}enter(t,e,i,n){let s=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n,a=this._activeDraggables,o=a.indexOf(t),l=t.getPlaceholderElement(),c=a[s];if(c===t&&(c=a[s+1]),!c&&(s==null||s===-1||s-1&&a.splice(o,1),c&&!this._dragDropRegistry.isDragging(c)){let d=c.getRootElement();d.parentElement.insertBefore(l,d),a.splice(s,0,t)}else this._element.appendChild(l),a.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(n=>n.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return(this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions).findIndex(i=>i.drag===t)}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{cr(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:Fo(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getItemOffsetPx(t,e,i){let n=this.orientation==="horizontal",s=n?e.left-t.left:e.top-t.top;return i===-1&&(s+=n?e.width-t.width:e.height-t.height),s}_getSiblingOffsetPx(t,e,i){let n=this.orientation==="horizontal",s=e[t].clientRect,a=e[t+i*-1],o=s[n?"width":"height"]*i;if(a){let l=n?"left":"top",c=n?"right":"bottom";i===-1?o-=a.clientRect[l]-s[c]:o+=s[l]-a.clientRect[c]}return o}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,n=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let a=i[i.length-1].clientRect;return n?t>=a.right:e>=a.bottom}else{let a=i[0].clientRect;return n?t<=a.left:e<=a.top}}_getItemIndexFromPointerPosition(t,e,i,n){let s=this.orientation==="horizontal",a=this._itemPositions.findIndex(({drag:o,clientRect:l})=>{if(o===t)return!1;if(n){let c=s?n.x:n.y;if(o===this._previousSwap.drag&&this._previousSwap.overlaps&&c===this._previousSwap.delta)return!1}return s?e>=Math.floor(l.left)&&e=Math.floor(l.top)&&il?d.after(c):d.before(c),Zu(this._activeItems,l,s);let u=this._getRootNode().elementFromPoint(e,i);return a.deltaX=n.x,a.deltaY=n.y,a.drag=o,a.overlaps=d===u||d.contains(u),{previousIndex:l,currentIndex:s}}enter(t,e,i,n){let s=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n;s===-1&&(s=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[s],o=this._activeItems.indexOf(t);o>-1&&this._activeItems.splice(o,1),a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(s,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[n,s]=this._relatedNodes[i];n.parentNode===t&&n.nextSibling!==s&&(s===null?t.appendChild(n):s.parentNode===t&&t.insertBefore(n,s))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let n=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),s=n?this._activeItems.findIndex(a=>{let o=a.getRootElement();return n===o||o.contains(n)}):-1;return s===-1||!this._sortPredicate(s,t)?-1:s}_getRootNode(){return this._rootNode||(this._rootNode=us(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let n=1/0,s=-1;for(let a=0;a!0,this.sortPredicate=()=>!0,this.beforeStarted=new B,this.entered=new B,this.exited=new B,this.dropped=new B,this.sorted=new B,this.receivingStarted=new B,this.receivingStopped=new B,this._isDragging=!1,this._draggables=[],this._siblings=[],this._activeSiblings=new Set,this._viewportScrollSubscription=qt.EMPTY,this._verticalScrollDirection=Ct.NONE,this._horizontalScrollDirection=qe.NONE,this._stopScrollTimers=new B,this._cachedShadowRoot=null,this._scrollableElements=[],this._direction="ltr",this._startScrollInterval=()=>{this._stopScrolling(),Xe(0,la).pipe(Ue(this._stopScrollTimers)).subscribe(()=>{let o=this._scrollNode,l=this.autoScrollStep;this._verticalScrollDirection===Ct.UP?o.scrollBy(0,-l):this._verticalScrollDirection===Ct.DOWN&&o.scrollBy(0,l),this._horizontalScrollDirection===qe.LEFT?o.scrollBy(-l,0):this._horizontalScrollDirection===qe.RIGHT&&o.scrollBy(l,0)})};let a=this.element=_i(t);this._document=i,this.withOrientation("vertical").withElementContainer(a),e.registerDropContainer(this),this._parentPositions=new fs(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,n){this._draggingStarted(),n==null&&this.sortingDisabled&&(n=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,n),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,n,s,a,o,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:n,isPointerOverContainer:s,distance:a,dropPoint:o,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(n=>n.isDragging()).every(n=>t.indexOf(n)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof Cs&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new Mo(this._document,this._dragDropRegistry);else{let e=new Cs(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=_i(this.element),i=this._scrollableElements.indexOf(this._container),n=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),n>-1&&this._scrollableElements.splice(n,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,n){if(this.sortingDisabled||!this._domRect||!Ou(this._domRect,Wu,e,i))return;let s=this._sortStrategy.sort(t,e,i,n);s&&this.sorted.next({previousIndex:s.previousIndex,currentIndex:s.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,n=Ct.NONE,s=qe.NONE;if(this._parentPositions.positions.forEach((a,o)=>{o===this._document||!a.clientRect||i||Ou(a.clientRect,Wu,t,e)&&([n,s]=Mf(o,a.clientRect,this._direction,t,e),(n||s)&&(i=o))}),!n&&!s){let{width:a,height:o}=this._viewportRuler.getViewportSize(),l={width:a,height:o,top:0,right:a,bottom:o,left:0};n=Yu(l,e),s=Qu(l,t),i=window}i&&(n!==this._verticalScrollDirection||s!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=n,this._horizontalScrollDirection=s,this._scrollNode=i,(n||s)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_isOverContainer(t,e){return this._domRect!=null&&ko(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(n=>n._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!ko(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let n=this._getShadowRoot().elementFromPoint(e,i);return n?n===this._container||this._container.contains(n):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(n=>this.enterPredicate(n,this)||this._draggables.indexOf(n)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=us(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Yu(r,t){let{top:e,bottom:i,height:n}=r,s=n*Xu;return t>=e-s&&t<=e+s?Ct.UP:t>=i-s&&t<=i+s?Ct.DOWN:Ct.NONE}function Qu(r,t){let{left:e,right:i,width:n}=r,s=n*Xu;return t>=e-s&&t<=e+s?qe.LEFT:t>=i-s&&t<=i+s?qe.RIGHT:qe.NONE}function Mf(r,t,e,i,n){let s=Yu(t,n),a=Qu(t,i),o=Ct.NONE,l=qe.NONE;if(s){let c=r.scrollTop;s===Ct.UP?c>0&&(o=Ct.UP):r.scrollHeight-c>r.clientHeight&&(o=Ct.DOWN)}if(a){let c=r.scrollLeft;e==="rtl"?a===qe.RIGHT?c<0&&(l=qe.RIGHT):r.scrollWidth+c>r.clientWidth&&(l=qe.LEFT):a===qe.LEFT?c>0&&(l=qe.LEFT):r.scrollWidth-c>r.clientWidth&&(l=qe.RIGHT)}return[o,l]}var ps=ar({passive:!1,capture:!0}),ms=new Set,Nf=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275cmp=Q({type:r,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],standalone:!0,features:[ue],decls:0,vars:0,template:function(i,n){},styles:["@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}"],encapsulation:2,changeDetection:0})}}return r})(),Ff=(()=>{class r{constructor(e,i){this._ngZone=e,this._appRef=b(Rr),this._environmentInjector=b(Ti),this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=Me([]),this._globalListeners=new Map,this._draggingPredicate=n=>n.isDragging(),this.pointerMove=new B,this.pointerUp=new B,this.scroll=new B,this._preventDefaultWhileDragging=n=>{this._activeDragInstances().length>0&&n.preventDefault()},this._persistentTouchmoveListener=n=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&n.preventDefault(),this.pointerMove.next(n))},this._document=i}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._persistentTouchmoveListener,ps)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,ps)}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._loadResets(),this._activeDragInstances.update(n=>[...n,e]),this._activeDragInstances().length===1)){let n=i.type.startsWith("touch");this._globalListeners.set(n?"touchend":"mouseup",{handler:s=>this.pointerUp.next(s),options:!0}).set("scroll",{handler:s=>this.scroll.next(s),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:ps}),n||this._globalListeners.set("mousemove",{handler:s=>this.pointerMove.next(s),options:ps}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((s,a)=>{this._document.addEventListener(a,s.handler,s.options)})})}}stopDragging(e){this._activeDragInstances.update(i=>{let n=i.indexOf(e);return n>-1?(i.splice(n,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this.scroll];return e&&e!==this._document&&i.push(new Hi(n=>this._ngZone.runOutsideAngular(()=>{let a=o=>{this._activeDragInstances().length&&n.next(o)};return e.addEventListener("scroll",a,!0),()=>{e.removeEventListener("scroll",a,!0)}}))),ca(...i)}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((e,i)=>{this._document.removeEventListener(i,e.handler,e.options)}),this._globalListeners.clear()}_loadResets(){if(!ms.has(this._appRef)){ms.add(this._appRef);let e=Zl(Nf,{environmentInjector:this._environmentInjector});this._appRef.onDestroy(()=>{ms.delete(this._appRef),ms.size===0&&e.destroy()})}}static{this.\u0275fac=function(i){return new(i||r)(D(Re),D(fe))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),Vf={dragStartThreshold:5,pointerDirectionChangeThreshold:5},$f=(()=>{class r{constructor(e,i,n,s){this._document=e,this._ngZone=i,this._viewportRuler=n,this._dragDropRegistry=s}createDrag(e,i=Vf){return new Oo(e,i,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(e){return new No(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}static{this.\u0275fac=function(i){return new(i||r)(D(fe),D(Re),D(wu),D(Ff))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),Gu=new ae("CDK_DRAG_PARENT");var Uf=new ae("CdkDragHandle");var Bf=new ae("CDK_DRAG_CONFIG"),Hf="cdk-drag",jf=new ae("CdkDropList"),Ju=(()=>{class r{static{this._dragInstances=[]}get disabled(){return this._disabled||this.dropContainer&&this.dropContainer.disabled}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}constructor(e,i,n,s,a,o,l,c,d,u,h){this.element=e,this.dropContainer=i,this._ngZone=s,this._viewContainerRef=a,this._dir=l,this._changeDetectorRef=d,this._selfHandle=u,this._parentDrag=h,this._destroyed=new B,this._handles=new te([]),this.scale=1,this.started=new W,this.released=new W,this.ended=new W,this.entered=new W,this.exited=new W,this.dropped=new W,this.moved=new Hi(p=>{let m=this._dragRef.moved.pipe(R(A=>({source:this,pointerPosition:A.pointerPosition,event:A.event,delta:A.delta,distance:A.distance}))).subscribe(p);return()=>{m.unsubscribe()}}),this._injector=b(Zt),this._dragRef=c.createDrag(e,{dragStartThreshold:o&&o.dragStartThreshold!=null?o.dragStartThreshold:5,pointerDirectionChangeThreshold:o&&o.pointerDirectionChangeThreshold!=null?o.pointerDirectionChangeThreshold:5,zIndex:o?.zIndex}),this._dragRef.data=this,r._dragInstances.push(this),o&&this._assignDefaults(o),i&&(this._dragRef._withDropContainer(i._dropListRef),i.addItem(this),i._dropListRef.beforeStarted.pipe(Ue(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){li(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,n=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this);let e=r._dragInstances.indexOf(this);e>-1&&r._dragInstances.splice(e,1),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(e){let i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),n=i.indexOf(e);n>-1&&(i.splice(n,1),this._handles.next(i))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):_i(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,n=this.dragStartDelay,s=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,a=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof n=="object"&&n?n:Su(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(s).withPreviewTemplate(a).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(ie(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){if(i.classList.contains(Hf)){e.withParent(r._dragInstances.find(n=>n.element.nativeElement===i)?._dragRef||null);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(e){let{lockAxis:i,dragStartDelay:n,constrainPosition:s,previewClass:a,boundaryElement:o,draggingDisabled:l,rootElementSelector:c,previewContainer:d}=e;this.disabled=l??!1,this.dragStartDelay=n||0,i&&(this.lockAxis=i),s&&(this.constrainPosition=s),a&&(this.previewClass=a),o&&(this.boundaryElement=o),c&&(this.rootElementSelector=c),d&&(this.previewContainer=d)}_setupHandlesListener(){this._handles.pipe(H(e=>{let i=e.map(n=>n.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),ee(e=>ca(...e.map(i=>i._stateChanges.pipe(Ii(i))))),Ue(this._destroyed)).subscribe(e=>{let i=this._dragRef,n=e.element.nativeElement;e.disabled?i.disableHandle(n):i.enableHandle(n)})}static{this.\u0275fac=function(i){return new(i||r)(S(Ie),S(jf,12),S(fe),S(Re),S(wi),S(Bf,8),S(Tu,8),S($f),S(Ne),S(Uf,10),S(Gu,12))}}static{this.\u0275dir=Se({type:r,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,n){i&2&&Pn("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",J],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Ge]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],standalone:!0,features:[zt([{provide:Gu,useExisting:r}]),Be,nt]})}}return r})();var eh={viewBox:"0 0 24 24",name:"externalLinkIcon",svgData:''};var th='',ih='',nh='',rh='';var vs=class r{constructor(t){this.templateRef=t}static{this.\u0275fac=function(e){return new(e||r)(S(Bt))}}static{this.\u0275dir=Se({type:r,selectors:[["","appTradingViewDisclaimer",""]],standalone:!0})}};var bs=class r{constructor(t){this.templateRef=t}static{this.\u0275fac=function(e){return new(e||r)(S(Bt))}}static{this.\u0275dir=Se({type:r,selectors:[["","appTradingViewDragIcon",""]],standalone:!0})}};var vt="1S",ys="1",sh="1440",dr=[vt,ys,"15",sh],ur=[vt,ys,"3","5","15","30","60","120","240","720",sh],Fi=new ae("ChartConfig");var ah="30",Sn="15";var it=1.23,Ot=class r{static processCandles(t,e,i,n){let s=t,a=e||s[0].time,o=i||s[s.length-1].time;o=Math.min(o,s[s.length-1].time);let l=n==="1S"?ci.roundToSecondsRange:ci.roundToMinuteRange,c=n==="1S"?1:+n;return r.sliceArray(s,l(a,c),l(o,c,!0))}static sliceArray(t,e,i){let n=ve.binarySearch(t,e,"time"),s=e===i?n:ve.binarySearch(t,i,"time");return n===0&&s===0&&t[0].time>i?[]:n===s?[t[n]]:t.slice(n,s+1)}static normalizeCandles(t){if(t.length<=1)return t;let e=t.slice(1);for(let[i,n]of e.entries())n.open=t[i].close;return t}static normalizeExtremes(t,e="upper-extremes-only"){if(t.length<=1)return t;for(let[i,n]of[...t].entries()){let s=t[i===0?i+4:i-1],a=t[i+4];s&&a&&(e!=="lower-extremes-only"&&n.close>s.high*it&&n.close>a.high*it&&a.closes.low/it&&(n.close=n.open,n.high=Math.max(n.high,n.close),t[i+1].open=n.close),n.lown.close&&(n.low=Math.min(n.low,Math.min(n.close,n.open))),n.high>n.open*it&&n.high>n.close*it?n.high=Math.max(n.close*it,n.open*it):n.high0&&ve.concatLargeArray(t,e,"time"),{affectedCandles:e,allCandles:t};let i=e,n=t[0].time,s=t[t.length-1].time,a=e[0].time,o=e[e.length-1].time,l=o=s||a<=s&&!l){let c=[],d=ve.binarySearch(t,a,"time"),u=ve.binarySearch(t,o,"time"),h=t.splice(d,u-d+1),p=r.overwriteCandles(h,e);return h.length===0||p.length===0||p.length>0&&p[p.length-1].time>h[h.length-1].time?(ve.concatLargeArray(c,h,"time"),ve.concatLargeArray(c,p,"time")):(ve.concatLargeArray(c,p,"time"),ve.concatLargeArray(c,h,"time")),ve.concatLargeArray(t,c,"time"),{affectedCandles:c,allCandles:t}}return ve.concatLargeArray(t,i,"time"),{affectedCandles:i,allCandles:t}}static overwriteCandles(t,e){let i=e.slice(0);for(let n of t){let s=ve.binarySearch(i,n.time,"time"),a=i[s];a&&a.time===n.time&&(n.volume=a.volume,n.high=a.high,n.low=a.low,n.close=a.close,i.splice(s,1))}return i}static getDefaultDaysAgo(t){return+t<=5?1:+t<=15?2:+t<=30?3:5}static fillGapsMissingCandles(t,e){if(!t||t.length===0)return[];let i=e===vt?Yi:+e*Wt,n=[],s=0;for(;sj(f({},i),{high:i.high*e,low:i.low*e,open:i.open*e,close:i.close*e}))}};var zf="usd",Wf="30",Ss=class{constructor(t,e,i,n){this._candles=new Map;this._spanUsedPerResolution=new Map;this._millisRangeLimitInApiByResolution=new Map([["1S",Date.now()-6*Ke]]);this._oldestTsInChart=new Map;this._oldestTsRequestedToApi=new Map;this._nextTsRequestToApi=new Map;this._chartIndicator="price";this.id=t,this.symbol=e,this.isStableSymbol=i,this.apiVersion=n,this._currentResolution=Wf,this._chartTokenRef=zf;for(let s of this.apiVersion==="v1"?dr:ur)this._candles.set(s,{usd:{price:[],mcap:[]},eth:{price:[],mcap:[]}});this.maxMinPrices={eth:{price:{max:null,min:null},mcap:{max:null,min:null}},usd:{price:{max:null,min:null},mcap:{max:null,min:null}}},this.maxMinPrices$=new te(this.maxMinPrices)}get resolution(){return this._currentResolution}setResolution(t){t!==this._currentResolution&&(this._currentResolution=t)}get chartTokenRef(){return this._chartTokenRef}setChartTokenRef(t){this._chartTokenRef=t,this._recalculateStats(),this.maxMinPrices$.next(this.maxMinPrices)}get historyVersion(){return this._historyVersion}setHistoryVersion(t){this._historyVersion=t}get oldestTsInApi(){return this._oldestTsInApi}setOldestTsInApi(t){this._oldestTsInApi=t==null?void 0:+t}getOldestTsRequestedToApi(t){let e=`${this.chartTokenRef}-${this._chartIndicator}-${t}`;return this._oldestTsRequestedToApi.get(e)}setOldestTsRequestedToApi(t,e){let i=`${this.chartTokenRef}-${this._chartIndicator}-${t}`;this._oldestTsRequestedToApi.set(i,e)}getOldestTsInChart(t){let e=`${this.chartTokenRef}-${this._chartIndicator}-${t}`;return this._oldestTsInChart.get(e)}setOldestTsInChart(t,e){let i=`${this.chartTokenRef}-${this._chartIndicator}-${t}`;this._oldestTsInChart.set(i,e)}setNextTsRequestToApi(t,e){let i=`${this.chartTokenRef}-${this._chartIndicator}-${t}`;this._nextTsRequestToApi.set(i,e)}getNextTsRequestToApi(t){let e=`${this.chartTokenRef}-${this._chartIndicator}-${t}`;return this._nextTsRequestToApi.get(e)}setOptimalSpan(t,e){this._spanUsedPerResolution.set(t,e)}getOptimalSpan(t){return this._spanUsedPerResolution.get(t)}getOldestTsInApiByResolution(t){return this._millisRangeLimitInApiByResolution.get(t)}setOldestTsInApiByResolution(t,e){this._millisRangeLimitInApiByResolution.set(t,e)}setChartIndicator(t){this._chartIndicator=t}getChartIndicator(){return this._chartIndicator}setAllCandles(t,e,i){this._candles.get(e)[i][this._chartIndicator]=t}updateWithLiveSwaps(t,e,i,n=null,s=!1,a){return se(this,null,function*(){if(t.length===0)return;let o=this.getImmediateSupportedApiResolution(this._currentResolution),l=this._candles.get(o)[this._chartTokenRef][this._chartIndicator],c=JSON.parse(JSON.stringify(t)),d=o==="1S"?ci.roundToSecondsRange:ci.roundToMinuteRange,u=o==="1S"?1:+o;for(let _ of c)_.timestamp=d(_.timestamp*1e3,u);let h=c[c.length-1].timestamp,p=c.filter(_=>_.timestamp===h),m=l[l.length-1]?.time;if(l[l.length-1]?.lastTimestamp&&(m=d(l[l.length-1].lastTimestamp*1e3,u)),l.length>0&&m>h)return;let A=p.reduce((_,x)=>{let k=this._chartTokenRef==="usd"?x.pool?.price??x.price:x.pool?.priceETH??x.priceETH;_[0].volume+=k*(this.isStableSymbol&&this._chartTokenRef==="usd"?x.amountETH:x.amountToken);let U=_[0],Y=k;return this._chartIndicator==="mcap"&&a&&(Y=Y*a),U.high=Math.max(U.high||Y,Y),U.low=Math.min(U.low||Y,Y),U.close=Y,U.open=U.open||Y,_},[{time:h,close:0,open:0,high:0,low:0,volume:0}]);if(l.length>0&&m===h){let _=l[l.length-1],x=A[0];return x&&(_.high=Math.max(_.high,x.high),_.low=Math.min(_.low,x.low),_.close=x.close,_.volume+=x.volume),this._recalculateStats(),[f({},_)]}else if(!s&&l.length===0||l.length>0&&m!(u.high===0||u.open===0||u.close===0));if(a.length===0){console.warn("Candles: could not add received candles because they contain invalid data (props with value 0 or null)");return}let o=this._candles.get(e)[this._chartTokenRef][this._chartIndicator],l=o.length;this._chartIndicator==="mcap"&&s&&(a=n?yield n("convertToMcapCandles",this,a,s):Ot.convertToMcapCandles(a,s));let c=ve.binarySearch(o,a[0].time,"time"),d;if(n==null)d=Ot.mergeCandles(o,a).affectedCandles;else{let{affectedCandles:u,allCandles:h}=yield n("mergeCandles",this,o,a);d=u,this.setAllCandles(h,e,this._chartTokenRef)}if(d.length>0){let u=ve.binarySearch(o,d[0].time,"time");if(o.length>0&&u>0&&l&&(o[u].open=o[u-1].close),c>=0&&o.length>0){let h=Math.max(0,c-4),p=Math.min(4,c);d=o.slice(h,h+p).concat(d)}if(n==null)d=Ot.normalizeCandles(d),i&&(d=Ot.normalizeExtremes(d));else{d=yield n("normalizeCandles",this,d),i&&(d=yield n("normalizeExtremes",this,d));let{affectedCandles:h,allCandles:p}=yield n("mergeCandles",this,o,[...d]);d=h,this.setAllCandles(p,e,this._chartTokenRef)}this._recalculateStats(d)}})}getCandles(s,a){return se(this,arguments,function*(t,e,i=this._currentResolution,n=null){this.setResolution(i);let o=this._candles.get(i)[this._chartTokenRef][this._chartIndicator];if(o.length===0)return[];let l=o[o.length-1].time,c=o[0].time;t=t||c,e=e||l;let d=i==="1S"?ci.roundToSecondsRange:ci.roundToMinuteRange,u=i==="1S"?1:+i,h=d(Math.min(l,t),u),p=d(e,u,!0);if(pi.max?n.high:i.max,i.min=n.low0?this._candles.get(t)[this._chartTokenRef][this._chartIndicator][0]:void 0}getFirstCandleStartingFrom(t,e=this._currentResolution){let i=this._candles.get(e)[this._chartTokenRef][this._chartIndicator];return i[ve.binarySearch(i,t,"time")]}getLastCandle(t=this._currentResolution){let e=this._candles.get(t)[this._chartTokenRef][this._chartIndicator];return e.length>0?e[e.length-1]:void 0}getImmediateSupportedApiResolution(t){return t===vt?vt:this.apiVersion==="v1"?[...dr].reverse().find(e=>+e<=+t):[...ur].reverse().find(e=>+e<=+t)}};var oh="latestResolution",Gf=10,In=class r{constructor(){this._workerResolves=new Map;this._workerPending=new Map;this._workerPendingId=0;this._cachedPairIds=[];this._cachedCharts=new Map;this._worker=null;li({read:()=>{try{this.updateResolution(ne.getString(oh)||Sn),this._worker=new Worker(new URL("worker-IQ6IDSVR.js",import.meta.url),{type:"module"}),this._setWorkerMessageHandler(this._worker)}catch(t){console.warn("Candles: could not create worker. Error:",t),this._worker=null}}})}get _sendWorkerMessageFn(){return this._worker?this.sendWorkerMessage.bind(this):null}get latestResolution(){return this._latestResolution}updateResolution(t){let e=!t||`${t}`=="null"?Sn:t;ne.setString(oh,e),this._latestResolution=e}getCandlesData(t,e,i,n="v1"){this._currentChartId!==t&&this._cachedCharts.clear(),this._currentChartId=t;let s=this._cachedCharts.get(t);if(s==null){if(s=new Ss(t,e,i,n),this._cachedPairIds.length>=Gf){let a=this._cachedPairIds.pop();this._cachedCharts.delete(a)}this._cachedPairIds.unshift(t),this._cachedCharts.set(t,s)}else this._cachedPairIds.splice(this._cachedPairIds.indexOf(t),1),this._cachedPairIds.unshift(t);return s}clearCachedChartById(t){let e=this._cachedPairIds.find(i=>i===t);e&&this._cachedCharts.delete(e)}clearAll(){this._cachedCharts.clear(),this._cachedPairIds.length=0}getCandles(t,e,i,n){return se(this,null,function*(){return t.getCandles(e,i,n,this._sendWorkerMessageFn)})}updateWithLiveSwaps(t,e,i=!0,n=!0,s=!1,a){return se(this,null,function*(){return t.updateWithLiveSwaps(e,i,n,this._sendWorkerMessageFn,s,a)})}addCandles(t,e,i,n=!0,s){return se(this,null,function*(){return t.addCandles(e,i,n,this._sendWorkerMessageFn,s)})}getCandlesForChart(t,e,i,n,s,a,o=0){return se(this,null,function*(){let l=Math.max(i,o),c=yield this._getMinimumNumberOfCandles(t,e,l,n,s,a);return c.length===1&&c[0].time===o&&c.pop(),yield t.normalizeCandles(c,this._sendWorkerMessageFn)})}sendWorkerMessage(t,e,...i){return se(this,null,function*(){let s=`${e.id}-${this._workerPendingId}`;if(this._worker){if(this._workerPending.has(s))return this._workerPending.get(s);this._worker.postMessage({type:t,data:{id:s,candlesArray:[],args:i}}),this._workerPendingId++;let a=new Promise(o=>{this._workerResolves.set(s,o)}).then(o=>(this._workerResolves.delete(s),o));return this._workerPending.set(s,a),a}})}_setWorkerMessageHandler(t){t.addEventListener("message",e=>{let{data:i}=e.data,{id:n,result:s}=i;this._workerResolves.has(n)&&this._workerResolves.get(n)(s),this._workerResolves.delete(n)})}_getMinimumNumberOfCandles(t,e,i,n,s,a=!1){return se(this,null,function*(){let o=yield this.getCandles(t,e,i,n),l=o,c=l.length;if(a&&o.length>0){let u=n===vt?Yi:+n*Wt;c=(o[o.length-1].time-o[0].time)/u+1}if(s-c>0){if(t.oldestTsInApi==null)return l;if(e===t.oldestTsInApi)return a&&o.length>1&&(l=yield t.fillGapsMissingCandles(o,n,this._sendWorkerMessageFn)),l;let u=t.oldestTsInApi;return n===vt&&(u=Math.max(e-6*Ke,t.oldestTsInApi)),this._getMinimumNumberOfCandles(t,u,i,n,s,a)}else return a&&o.length>1&&(l=yield t.fillGapsMissingCandles(o,n,this._sendWorkerMessageFn)),l})}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var qf="1440",Zf="4320",Xf="10080",Yf="43200",Bo="USD",lh=new RegExp(Bo,"i"),ch=()=>({id:"0",time:0,color:"yellow",text:"none",label:"none",labelFontColor:"white",minSize:20}),dh=()=>({id:"0",time:0,color:"yellow",label:"none",tooltip:[]}),uh={"1S":0,1:60,3:3*60,5:5*60,15:15*60,30:30*60,60:60*60,120:120*60,240:240*60,720:720*60,"1D":0,"3D":0,"1W":0,"1M":0},ii={"3h":3*Ke,"6h":6*Ke,day:Fe,week:7*Fe,month:30*Fe},Qf={"3h":{min:0,max:3*Ke},"6h":{min:3*Ke+1,max:6*Ke},day:{min:6*Ke+1,max:2*Fe},week:{min:2*Fe+1,max:7*Fe},month:{min:7*Fe+1,max:Number.MAX_SAFE_INTEGER}},$o=new Map([["1S",{min:"3h",max:"6h"}],["1",{min:"3h",max:"week"}],["3",{min:"3h",max:"week"}],["5",{min:"3h",max:"week"}],["15",{min:"3h",max:"week"}],["30",{min:"3h",max:"month"}],["60",{min:"3h",max:"month"}],["120",{min:"3h",max:"month"}],["240",{min:"6h",max:"month"}],["720",{min:"6h",max:"month"}],["1440",{min:"6h",max:"month"}],["4320",{min:"day",max:"month"}],["10080",{min:"day",max:"month"}],["43200",{min:"day",max:"month"}]]),Uo=Object.entries(ii).map(r=>r[0]),he=class r{static{this.supportedTimeZones={"Africa/Cairo":2,"Africa/Casablanca":0,"Africa/Johannesburg":2,"Africa/Lagos":1,"Africa/Nairobi":3,"Africa/Tunis":1,"America/Anchorage":-9,"America/Argentina/Buenos_Aires":-3,"America/Bogota":-5,"America/Caracas":-4,"America/Chicago":-5,"America/El_Salvador":-6,"America/Juneau":-8,"America/Lima":-5,"America/Los_Angeles":-7,"America/Mexico_City":-5,"America/New_York":-4,"America/Phoenix":-7,"America/Santiago":-3,"America/Sao_Paulo":-3,"America/Toronto":-4,"America/Vancouver":-7,"Asia/Almaty":6,"Asia/Ashkhabad":5,"Asia/Bahrain":3,"Asia/Bangkok":7,"Asia/Chongqing":8,"Asia/Colombo":5.5,"Asia/Dhaka":6,"Asia/Dubai":4,"Asia/Ho_Chi_Minh":7,"Asia/Hong_Kong":8,"Asia/Jakarta":7,"Asia/Jerusalem":3,"Asia/Karachi":5,"Asia/Kathmandu":5.75,"Asia/Kolkata":3.5,"Asia/Kuala_Lumpur":8,"Asia/Kuwait":3,"Asia/Manila":8,"Asia/Muscat":4,"Asia/Nicosia":3,"Asia/Qatar":3,"Asia/Riyadh":3,"Asia/Seoul":9,"Asia/Shanghai":8,"Asia/Singapore":8,"Asia/Taipei":8,"Asia/Tehran":4.5,"Asia/Tokyo":9,"Asia/Yangon":6.5,"Atlantic/Azores":0,"Atlantic/Reykjavik":0,"Australia/Adelaide":9.5,"Australia/Brisbane":10,"Australia/Perth":8,"Australia/Sydney":10,"Europe/Amsterdam":2,"Europe/Athens":3,"Europe/Belgrade":2,"Europe/Berlin":2,"Europe/Bratislava":2,"Europe/Brussels":2,"Europe/Bucharest":3,"Europe/Budapest":2,"Europe/Copenhagen":2,"Europe/Dublin":1,"Europe/Helsinki":3,"Europe/Istanbul":3,"Europe/Lisbon":1,"Europe/London":1,"Europe/Luxembourg":2,"Europe/Madrid":2,"Europe/Malta":2,"Europe/Moscow":3,"Europe/Oslo":2,"Europe/Paris":2,"Europe/Prague":2,"Europe/Riga":3,"Europe/Rome":2,"Europe/Stockholm":2,"Europe/Tallinn":3,"Europe/Vienna":2,"Europe/Vilnius":3,"Europe/Warsaw":2,"Europe/Zurich":2,"Pacific/Auckland":12,"Pacific/Chatham":12.75,"Pacific/Fakaofo":13,"Pacific/Honolulu":-10,"Pacific/Norfolk":11,"US/Mountain":-7}}static getSupportedTimeZone(t){if(r.supportedTimeZones[t]!=null)return t;let e=new Date().getTimezoneOffset()/-60,i=Object.keys(r.supportedTimeZones).find(n=>r.supportedTimeZones[n]===e);return i||(console.warn("Cannot find supported Timezone - using UTC"),"Etc/UTC")}static getChartOverrides(t){let e={"paneProperties.background":t.paneProperties.background,"paneProperties.vertGridProperties.color":t.paneProperties.vertGridProperties.color,"paneProperties.horzGridProperties.color":t.paneProperties.horzGridProperties.color,"paneProperties.axisProperties.autoScale":t.paneProperties.axisProperties.autoScale,"symbolWatermarkProperties.color":"rgba(0, 0, 0, 0.00)","symbolWatermarkProperties.visibility":!0,"scalesProperties.textColor":t.scalesProperties.textColor,"scalesProperties.lineColor":t.scalesProperties.lineColor,"mainSeriesProperties.minTick":t.mainSeriesProperties.minTick,"mainSeriesProperties.priceAxisProperties.autoScale":t.mainSeriesProperties.priceAxisProperties.autoScale};return t.mainSeriesProperties.style&&(e["mainSeriesProperties.style"]=t.mainSeriesProperties.style),e}static getChartDisabledFeatures(){return["show_interval_dialog_on_key_press","symbol_search_hot_key","display_market_status","header_compare","header_symbol_search","header_fullscreen_button","control_bar","edit_buttons_in_legend","border_around_the_chart","border_around_the_chart","remove_library_container_border"]}static getChartDisabledFeaturesWidget(){return["left_toolbar","show_interval_dialog_on_key_press","symbol_search_hot_key","display_market_status","header_compare","header_symbol_search","header_fullscreen_button","control_bar","edit_buttons_in_legend","border_around_the_chart","context_menus","border_around_the_chart","remove_library_container_border"]}static shouldLoadTVInCompatibilityMode(t){return t.IOS&&(window.ethereum||window.phantom||window.solflare)||window.TelegramWebviewProxy?!0:t.ANDROID}static calculateInitialResolution(t,e,i,n){let s=t?ah:Sn,a=n?n.time:e,o=(Date.now()-a)/Fe;return o<.3?s="1":o<.7?s="5":o<1?s="15":i<10?s="120":i<40&&(s="60"),s}static getResolvedChartData(t,e,i,n,s,a,o){return{name:t,description:t,pricescale:e,minmov:1,minmove2:0,session:"24x7",type:"crypto",exchange:"DEXTools.io",timezone:r.getSupportedTimeZone(Intl.DateTimeFormat().resolvedOptions().timeZone),has_empty_bars:!1,has_daily:!0,has_seconds:!0,daily_multipliers:["1"],has_weekly_and_monthly:!1,has_intraday:!0,intraday_multipliers:(i==="v1"?dr:ur).filter(d=>![vt,"1440"].includes(d)),seconds_multipliers:["1"],format:"price",logo_urls:o?[o]:[]}}static getChartTokenRef(t,e,i,n=!1){let s;return t&&!n||!t&&n?s=lh.test(i??"")?Bo:e:s=lh.test(i??"")?e:Bo,s}static transformToNumericResolution(t){let e=t?`${t}`:Sn;switch(e){case"1D":case"D":return qf;case"3D":return Zf;case"1W":return Xf;case"1M":return Yf;default:return e}}static getSuitableTimeSpan(t,e,i){let n=Math.round((i-e)/Fe),s={suitableTimeSpan:"day",suitableTimeSpanMs:Fe};if(t==="1S"){let a=Math.round((i-e)/Ke);s={suitableTimeSpan:a>3?"6h":"3h",suitableTimeSpanMs:Ke*(a>3?6:3)}}else+t>=15||n>20?s={suitableTimeSpan:"month",suitableTimeSpanMs:Fe*30}:n>3&&(s={suitableTimeSpan:"week",suitableTimeSpanMs:Fe*7});return s}static getSuitableTimeSpanV2(t,e,i){return this._getOptimalSpanForResolution(e,i,$o.get(t)?.min??"week",$o.get(t)?.max??"month")}static _getOptimalSpanForResolution(t,e,i,n){let s=e-t,a=ii[i],o=ii[n],l=Object.entries(Qf);for(let[c,{min:d,max:u}]of l)if(!(ii[c]o)&&s>=d&&s<=u)return{suitableTimeSpan:c,suitableTimeSpanMs:ii[c]};return{suitableTimeSpan:n,suitableTimeSpanMs:o}}static getNumberCandlesForSpanAndResolution(t,e){let i=ii[t],n;return e==="1S"?n=Yi:n=+e*Wt,Math.floor(i/n)}static getAdjustedSpanForCandleDensity(t,e,i){let n=r.getNumberCandlesForSpanAndResolution(t,e),s=Math.floor(n/4);return i=s?i.max:Uo[n+1]}static getMarks(t,e,i,n,s){let a=[];for(let[o,l]of t.entries())a.push(i(l,o,e,n,s));return a}static getTimescaleMarks(t,e,i){let n=[];for(let[s,a]of t.entries())n.push(i(a,s,e));return n}};var Tn=100,Is=10,Jf={"1S":1e3,1:1e3,3:900,5:800,15:650,30:450,60:350,120:325,240:300,720:250,1440:100,4320:100,10080:100,43200:100},bt=class r{constructor(t,e){this._apiService=t;this._chartConfig=e;this._customBackgroundPlatformColor=void 0;this._customBackgroundPaneColor=void 0;if(this._chartConfig==null)throw new Error("Chart: missing config")}setCustomBackgroundPlatformColor(t){this._customBackgroundPlatformColor=t}get customBackgroundPlatformColor(){return this._customBackgroundPlatformColor}setCustomBackgroundPaneColor(t){this._customBackgroundPaneColor=t}get customBackgroundPaneColor(){return this._customBackgroundPaneColor}getStorageUrl(t){return t?"":this._apiService.retrieveChartsPath("/tv")}getThemeOverridesObject(t){let e=t==="dark"?this._chartConfig.backgroundDark:this._chartConfig.backgroundLight;this.customBackgroundPlatformColor&&(e=this.customBackgroundPlatformColor);let i={paneProperties:{background:e,vertGridProperties:{color:"#dee2e6"},horzGridProperties:{color:"#dee2e6"},axisProperties:{autoScale:!0}},scalesProperties:{textColor:"#5a6169",lineColor:"#5a6169"},mainSeriesProperties:{style:void 0,minTick:"100000000,1,false",priceAxisProperties:{autoScale:!0}}};return t==="dark"&&(i={paneProperties:{background:e,vertGridProperties:{color:"rgba(167,168,173,0.11)"},horzGridProperties:{color:"rgba(167,168,173,0.11)"},axisProperties:{autoScale:!0}},scalesProperties:{textColor:"#a7a8ad",lineColor:"#a7a8ad"},mainSeriesProperties:{style:void 0,minTick:"100000000,1,false",priceAxisProperties:{autoScale:!0}}}),i}getCandles(t,e,i,n="1",s,a,o,l,c,d,u,h=!0){let p=new Date().getTimezoneOffset()/-60,m=he.getSuitableTimeSpan(n,s,a),A=m.suitableTimeSpan,_=m.suitableTimeSpanMs,x=Math.floor(a/_)*_,k=x,U=[];for(;k>=s-_;)d!=null&&k>=d?console.warn(`Candles: timestamp ${k} already fetched. Oldest timestamp fetched: ${d}`):u!=null&&k>=u?console.warn(`Candles: timestamp ${k} already requested to API. Oldest timestamp requested: ${u}`):U.push({startTs:k}),x=k,k=x-_;let Y=[],oe,De=C({version:l,symbol:i,candles:[],oldestTs:c});return h&&(De=t.getOnTheFlyCandles(e,i,n,p,o).pipe(ge(ye=>(console.error('Candles: could not fetch "latest" candles due to error',ye),C({version:l,symbol:i,candles:[],oldestTs:c}))))),De.pipe(H(ye=>{Y.push(...ye.candles),Y.length>0&&(oe=Y[0].time),l=ye.version,c=ye.oldestTs?+ye.oldestTs:void 0,U=U.filter(P=>P.startTs+_>=+ye.oldestTs)}),ee(()=>{let ye=U.map((P,N)=>Pe(Tn*N+10).pipe(ee(()=>t.getCandles(e,i,n,P.startTs,A,o,l,p).pipe(Sr(G=>{let K=0;return G.pipe(ke(le=>K0?Dn(...ye):C([{version:l,symbol:i,candles:[],oldestTs:c??-1}])}),R(ye=>{let P={version:l,symbol:i,candles:[],oldestTs:c??-1};for(let N of ye.reverse()){let G=[],K=0;for(let le of[...N.candles].reverse())if(oe&&le.time>=oe)K++;else{G=N.candles.slice(0,N.candles.length-K);break}P.candles.push(...G)}return P.candles.push(...Y),{rawCandles:P,requests:U}}))}getCandlesV2(t,e,i,n="1",s,a,o,l,c,d,u=!0,h){let p=new Date().getTimezoneOffset()/-60,m;l?m=l:m=he.getSuitableTimeSpanV2(n,s,a).suitableTimeSpan;let A=C({symbol:i,candles:[],oldestTs:d}),_=C(d??null);return d||(_=t.getOldestCandleDate(o,e).pipe(R(x=>x?.oldestCandle?x.oldestCandle.timestamp:null),ge(x=>(console.error('Candles: could not fetch "oldest timestamp" candles due to error',x),C(null))))),u&&(A=t.getOnTheFlyCandles(e,i,n,p,o,m).pipe(R(x=>f(f({},x),x.candles.reverse())),ge(x=>(console.error('Candles: could not fetch "latest" candles due to error',x),C({symbol:i,candles:[]}))))),_.pipe(ee(x=>x?A.pipe(ee(k=>{let U=k.nextTs??c;return U&&!u&&this._hasExceededLimitTsInApi(x,U,h)?C({rawCandles:{symbol:i,candles:[]},requestedSpan:m}):U&&(u&&k.candles.length>0||!u&&U>=x)?this._getAndManageCandlesWithNextTs(t,e,i,n,o,s,U,m,p,x,h).pipe(R(Y=>{let oe=Y.candles.reverse(),De={symbol:i,candles:oe,nextTs:Y.nextTs,firstTs:Y.firstTs,oldestTs:x};if(u){let ye=oe.findIndex(N=>k.firstTs&&N.time>=k.firstTs),P=ye===-1?oe:oe.slice(0,ye);De.candles=[...P,...k.candles]}return{rawCandles:De,requestedSpan:m}}),ge(Y=>(console.error("Candles: could not fetch candles due to error",Y),C({rawCandles:{symbol:i,candles:[],oldestTs:x},requestedSpan:m})))):C({rawCandles:k,requestedSpan:m})})):C({rawCandles:{symbol:i,candles:[]},requestedSpan:m})))}getCandlesV3(t,e,i,n="1",s,a,o,l,c,d,u=!0,h){let p=new Date().getTimezoneOffset()/-60,A=he.getSuitableTimeSpanV2(n,a,o).suitableTimeSpan,_=C({symbol:i,candles:[],oldestTs:d}),x=C(d??null);return d||(x=t.getOldestCandleDate(l,e).pipe(R(k=>k?.oldestCandle?k.oldestCandle.timestamp:null),ge(k=>(console.error('Candles: could not fetch "oldest timestamp" candles due to error',k),C(null))))),u&&(_=t.getOnTheFlyCandles(e,i,n,p,l,A).pipe(R(k=>f(f({},k),k.candles.reverse())),ge(k=>(console.error('Candles: could not fetch "latest" candles due to error',k),C({symbol:i,candles:[]}))))),x.pipe(ee(k=>k?_.pipe(ee(U=>{let Y=U.nextTs??c;return Y&&!u&&this._hasExceededLimitTsInApi(k,Y,h)?C({rawCandles:{symbol:i,candles:[]},requestedSpan:A}):Y&&(u&&U.candles.length>0||!u&&Y>=k)?this._getAndManageCandlesByAmount(t,e,i,n,l,a,Y,p,k,s,h).pipe(R(oe=>{let De=oe.candles.reverse(),ye={symbol:i,candles:De,nextTs:oe.nextTs,firstTs:oe.firstTs,oldestTs:k};if(u){let P=De.findIndex(G=>U.firstTs&&G.time>=U.firstTs),N=P===-1?De:De.slice(0,P);ye.candles=[...N,...U.candles]}return{rawCandles:ye,requestedSpan:A}}),ge(oe=>(console.error("Candles: could not fetch candles due to error",oe),C({rawCandles:{symbol:i,candles:[],oldestTs:k},requestedSpan:A})))):C({rawCandles:U,requestedSpan:A})})):C({rawCandles:{symbol:i,candles:[]},requestedSpan:A})))}_getAndManageCandlesWithNextTs(t,e,i,n="1",s,a,o,l,c,d,u){return t.getCandles(e,i,n,o,l,s,c).pipe(R(h=>(l=he.getAdjustedSpanForCandleDensity(l,n,h.candles.length),h)),ua(h=>n==="1S"?this._manageCandles1S(t,e,i,n,s,a,h.nextTs,l,c,d,u):h.nextTs&&(o=d&&!this._hasExceededLimitTsInApi(d,o,u)?t.getCandles(e,i,n,h.nextTs,l,s,c):dt),yr({count:Is,delay:this._shouldRetry$}),kn((h,p)=>{let m=ve.removeDuplicatesByKey(p.candles,h.candles,"time");return j(f({},p),{candles:[...h.candles,...m]})}),Ln(),ge(h=>(console.error("Candles: could not fetch candles due to error",h),C({symbol:i,candles:[]}))))}_shouldRetry$(t){if(t.status===400&&t.error.errorCode===1e4)throw t;return Pe(ft.generateDynamicDelay(Tn))}_getAndManageCandlesByAmount(t,e,i,n="1",s,a,o,l,c,d,u){let h=Jf[n],p=0;return t.getCandlesByAmount(e,i,n,o,s,h,l).pipe(ua(m=>(p+=m.candles.length,m.nextTs&&m.nextTs>=c&&pPe(ft.generateDynamicDelay(Tn))}),kn((m,A)=>{let _=ve.removeDuplicatesByKey(A.candles,m.candles,"time");return j(f({},A),{candles:[...m.candles,..._]})}),Ln(),ge(m=>(console.error("Candles: could not fetch candles due to error",m),C({symbol:i,candles:[]}))))}_manageCandles1S(t,e,i,n="1",s,a,o,l,c,d,u){if(o&&a=d&&!this._hasExceededLimitTsInApi(d,o,u)){let h=this._getNextTsList(o,a,l).map((p,m)=>Pe(Tn*m+10).pipe(ee(()=>t.getCandles(e,i,n,p,l,s,c).pipe(yr({count:Is,delay:()=>Pe(ft.generateDynamicDelay(Tn))}),ie(1)))));if(h.length>0)return Dn(...h).pipe(R(p=>{let m={candles:[],symbol:i};for(let A of p){let _=ve.removeDuplicatesByKey(A.candles,m.candles,"time");m=j(f({},A),{candles:[...m.candles,..._]})}return m}))}return dt}_getNextTsList(t,e,i){let n=ii[i],s=t,a=s,o=[];for(;a>=e-n;)o.push(a),s=a,a=s-n;return o}_hasExceededLimitTsInApi(t,e,i){return i&&(i({resizable:r}),sg=r=>({"trading-view__show-button":r}),ag=r=>({disclaimer:r});function og(r,t){r&1&&X(0,"div",4)}function lg(r,t){r&1&&Ye(0)}function cg(r,t){if(r&1){let e=pt();F(0,"span",7,2),xe("cdkDragMoved",function(){ce(e);let n=w();return de(n.dragMove())})("cdkDragStarted",function(){ce(e);let n=w();return de(n.toggleOverlay(!0))})("cdkDragReleased",function(){ce(e);let n=w();return de(n.toggleOverlay(!1))})("mousedown",function(){ce(e);let n=w();return de(n.toggleOverlay(!0))})("mouseup",function(){ce(e);let n=w();return de(n.toggleOverlay(!1))}),$(2,lg,1,0,"ng-container",8),O()}if(r&2){let e=w();v("ngClass",st(2,sg,e.showDragButton)),I(2),v("ngTemplateOutlet",e.dragIconSlot.templateRef)}}function dg(r,t){r&1&&Ye(0)}function ug(r,t){if(r&1&&$(0,dg,1,0,"ng-container",9),r&2){let e=w();v("ngTemplateOutlet",e.disclaimerSlot.templateRef)("ngTemplateOutletContext",st(2,ag,e.disclaimer))}}function hg(r,t){let e=b(bt,{optional:!0,skipSelf:!0});return e??(console.warn("Chart: no service instance found. Instantiating a new one."),new bt(r,t))}var hh="chartStateChecked",ph="chartSavedStateChecked2410",mh="chartStateCheckedTV27",Ts="chartSavedState",pg="chartSavedStateBackup",mg="chartSavedStateBackup2410",fg="chartSavedStateBackupTV27",ws=class r{constructor(t,e,i,n,s,a,o,l,c,d){this._candlesDataService=t;this._chartService=e;this._environment=i;this._authenticationService=n;this._ngZone=s;this._cdRef=a;this._renderer=o;this._platform=l;this._appStatusService=c;this._chartConfig=d;this.chartApiAdapter=null;this.chartApiV2Adapter=null;this.normalizeCandles=!1;this.fillCandlesGaps=!1;this.candlesData=null;this.defaultFavorites=[];this.countSwapsLast24h=null;this.selectedTransactions=[];this.selectedPositions=[];this.avgPrice=null;this.disclaimer=null;this.userAccess=!1;this.darkThemeUrl="css/custom_dext_dark.css";this.lightThemeUrl="css/custom_dext.css";this.chartResolution=null;this.chartType=null;this.chartSettingsStorage={savedPropertiesKey:"chartproperties",savedStateKey:"chartSavedState",storeSetting:()=>{},getStoredSetting:()=>"noop"};this.isFullScreen=!1;this.isDarkTheme=!0;this.isMulti=!1;this.isResizable=!1;this.allowMarksOnBars={enabled:!1,builder:ch};this.allowTimescaleMarksOnBars={enabled:!1,builder:dh};this.isUserIdEnabled=!0;this.showTokenRefChangeButton=!0;this.showMarketCapButton=!0;this.showMinMaxButtons=!0;this.showLeftToolbar=!0;this.secondsResolutionsEnabled=!0;this.extraMarks=Fl(()=>[]);this.liveCandlesCleared=new W;this.tvDestroyed=new W;this.fullScreenToggled=new W;this.candleNormalizationToggled=new W;this.fillTheGapsToggled=new W;this.tvReady=new W;this.showOverlay=!1;this.showDragButton=!1;this.screenHeight=window.innerHeight;this._hasSavedChartState=Me(!1);this._isFetchingCandles=!1;this._storeChartHeight$=new B;this._onResetChartData$=new B;this._pairSymbols=new Map;this._tradingview=null;this._liveCandlesSub=null;this._chartBarsSubscriptions=new Map;this._tradingViewEventsSubscriptions=new Map;this._chartState=null;this._btnChange=null;this._btnChangePriceMcap=null;this._minChart=null;this._maxChart=null;this._btnFull=null;this._activeChart=null;this._loadedApiResolutions=[];this._chartLoader=!0;this._isFullscreenChart=!1;this._destroyRef=b(Tr);this._avgOrderLine=Me(null);if(this._chartConfig==null)throw new Error("TradingView: missing config");this._appStatusService.isAppOnlineAndVisible$().pipe(pe(this._destroyRef)).pipe(Dl(()=>!this.isChartLoadedAndRendered)).subscribe(()=>{!this.isChartLoadedAndRendered&&!this.candlesData?.oldestTsInApi&&this._tradingview&&(this.chartLoader=!0,this.destroyChartElements(),this.drawTv())})}get chartLoader(){return this._chartLoader}set chartLoader(t){this._chartLoader=t,this._updateTVClasses()}get isFullscreenChart(){return this._isFullscreenChart}set isFullscreenChart(t){this._isFullscreenChart=t,this._updateTVClasses()}get isChartLoadedAndRendered(){return!!this._tradingview&&!!document.querySelector(`#${!!this._tradingview?._iFrame?.id}`)}ngOnInit(){ne.get(hh)&&ne.delete(hh),(!ne.get(ph)&&this.chartSettingsStorage.savedStateKey===Ts||!ne.get(mh)&&this.chartSettingsStorage.savedStateKey===Ts)&&this._checkRenameNewCharts(),this._chartState=this._getStoredChartSetting(this.chartSettingsStorage.savedStateKey),this.drawTv()}ngAfterViewInit(){if(this.isResizable){let t=this._getStoredChartSetting("resizedHeight");if(t!=null){let e=this.tradingViewContainer.nativeElement.closest(".trading-view");e!=null&&(e.style.height=t)}}}ngOnDestroy(){this._liveCandlesSub&&(this._liveCandlesSub.unsubscribe(),this._liveCandlesSub=null);let t=new Map(this._chartBarsSubscriptions);this._chartBarsSubscriptions.clear();for(let[,e]of t)e();t.clear(),this.liveCandlesCleared.complete(),this._onResetChartData$.complete(),this.destroyChartElements()}ngOnChanges(t){!t.isFullScreen?.isFirstChange()&&t.isFullScreen?.currentValue===!0&&t.isFullScreen?.previousValue!==t.isFullScreen?.currentValue&&this.toggleFullChart(),!t.isDarkTheme?.isFirstChange()&&t.isDarkTheme?.previousValue!==t.isDarkTheme?.currentValue&&(this.chartLoader=!0,this.destroyChartElements(),this.drawTv()),!t.extraMarks?.isFirstChange()&&t.extraMarks?.previousValue!==t.extraMarks?.currentValue&&this._tradingview&&this._tradingview.onChartReady(()=>{let e=this._tradingview?.chart();e!=null&&(e.clearMarks(),e.refreshMarks())})}destroyChartElements(){if(this._btnChange&&(this._btnChange.remove(),this._btnChange=null),this._btnFull&&(this._btnFull.remove(),this._btnFull=null),this._maxChart&&(this._maxChart.remove(),this._maxChart=null),this._minChart&&(this._minChart.remove(),this._minChart=null),this._resolveSymbolSub&&this._resolveSymbolSub.unsubscribe(),this._tradingview){if(this._activeChart?.onDataLoaded().unsubscribeAll(this),this._activeChart=null,this._tradingViewEventsSubscriptions.size>0){for(let[t,e]of this._tradingViewEventsSubscriptions.entries())try{this._tradingview.unsubscribe(t,e)}catch(i){console.warn(`Chart: could not remove ${t} subscription:`,i.message)}this._tradingViewEventsSubscriptions.clear()}this._saveChartState(),this._tradingview._iFrame.src="about:blank",this._tradingview.remove(),this._tradingview._options.datafeed={},this._tradingview._iFrame.remove(),this._tradingview=null,this.tvDestroyed.next(),this._cdRef.detectChanges()}}drawTv(){if(this.tokenData.symbol)if(this._tradingview)this._btnChange&&(this._btnChange.innerHTML=this._getBtnChangeName()),this._resetChartData(()=>{this._subscribeMaxMinPrices()});else{let t=this.isDarkTheme?"dark":"light",e=this.isDarkTheme?this.darkThemeUrl:this.lightThemeUrl,i=this._chartService.getThemeOverridesObject(t);i.paneProperties.background=this._chartService.customBackgroundPlatformColor??(this.isDarkTheme?this._chartConfig.backgroundDark:this._chartConfig.backgroundLight);let n=this._chartState;if(n)n.charts[0].chartProperties=ft.deepMerge(n.charts[0].chartProperties,i),n.charts[0].panes[0].sources[0].state.symbol=Ae.safeText(this._getUniquePairSymbol());else{let a=this._getStoredChartSetting(this.chartSettingsStorage.savedPropertiesKey)??{};a&&this._storeChartSetting(this.chartSettingsStorage.savedPropertiesKey,ft.deepMerge(a,i))}this._storeChartSetting("current_theme.name",t);let s=this.secondsResolutionsEnabled?["seconds_resolution"]:[];this.logo&&s.push("show_symbol_logos","show_symbol_logo_in_legend"),ft.isMobileDevice()&&s.push("hide_left_toolbar_by_default"),he.shouldLoadTVInCompatibilityMode(this._platform)&&s.push("iframe_loading_compatibility_mode"),s.push("create_volume_indicator_by_default"),setTimeout(()=>{if(!this.candlesData){console.warn("TradingView chart: could not load due to candles data missing.");return}if(this.tradingViewContainer==null){console.warn("TradingView chart: could not load due to container not found.");return}let a=this._authenticationService.getCurrentUserValue(),o=this.isUserIdEnabled?this._chartService.getStorageUrl(!a||!Kd.includes(a.plan)):"",l=this.chartResolution?.toUpperCase();if(l==null){let u=this._getStoredChartSetting("latestResolution");l=u,u&&console.log("TradingView chart: no initial resolution set. Falling back to last used resolution (if any).")}else console.log("TradingView chart: initial resolution explicitly set.",l);l==null&&(console.warn("TradingView chart: suitable initial resolution calculated based on the token's data."),l=he.calculateInitialResolution(this.userAccess,this.tokenData.created,this.countSwapsLast24h??6,this.candlesData.getOldestCandle(ys)));let c=["1","3","5","15","30","60","120","240","720","D","3D","W","M"],d=this.secondsResolutionsEnabled?["1S",...c]:c;this._tradingview=new window.TradingView.widget({theme:t,overrides:he.getChartOverrides(i),debug:!1,fullscreen:!0,custom_css_url:`${e}?${this._environment.appVersion}`,symbol:this._getUniquePairSymbol(),interval:l,favorites:this.defaultFavorites.length>0?{intervals:this.defaultFavorites}:void 0,container:this.tradingViewContainer.nativeElement,library_path:`${this._environment.app_scope}/assets/vendors/charting_library/`,locale:"en",disabled_features:this.showLeftToolbar?he.getChartDisabledFeatures():he.getChartDisabledFeaturesWidget(),enabled_features:s,saved_data:n?JSON.parse(JSON.stringify(n)):void 0,charts_storage_api_version:"1",charts_storage_url:o,client_id:this.clientId,user_id:this._authenticationService.authToken||void 0,timezone:he.getSupportedTimeZone(Intl.DateTimeFormat().resolvedOptions().timeZone),auto_save_delay:2,custom_formatters:{priceFormatterFactory:()=>({format:u=>ot.shortenPrice(u)})},datafeed:{getTimescaleMarks:(u,h,p,m)=>{let A=this.selectedTransactions.filter(k=>k.timestamp>=h&&k.timestamp0&&setTimeout(()=>{m(x)},50)},onReady:u=>{Pe(0).pipe(pe(this._destroyRef),H(()=>{u({supported_resolutions:d,supports_marks:this.allowMarksOnBars.enabled,supports_timescale_marks:this.allowTimescaleMarksOnBars.enabled})})).subscribe()},getMarks:(u,h,p,m,A)=>{let _=this._tradingview?.chart().getTimezoneApi().getTimezone().offset??0,x=uh[A]??+A,k=[...this.selectedTransactions,...this.selectedPositions].filter(N=>N.timestamp>=h&&N.timestamp{let G=N.imageUrl;return G&&(G=pi.isExternalUrl(G)||G.startsWith("data:image/svg+xml;base64,")?G:`${window.location.origin}${ye}/assets${G}`),j(f({},N),{imageUrl:G,time:N.time-x})});m(P)},getBars:(u,h,p,m)=>{this._ngZone.runOutsideAngular(()=>se(this,null,function*(){let{from:A,to:_,countBack:x}=p,k=A*1e3,U=_*1e3,Y=x,oe=this.candlesData;this.chartApiAdapter?this._manageCandles(this.chartApiAdapter,oe,m,k,U,Y):this.chartApiV2Adapter&&(this.fillCandlesGaps?this._manageCandlesV2(this.chartApiV2Adapter,oe,m,k,U,Y):this._manageCandlesV3(this.chartApiV2Adapter,oe,m,k,U,Y))}))},resolveSymbol:(u,h)=>{this._resolveSymbolSub=Pe(200).pipe(H(()=>{if(!this.tokenData.symbol)return;let p=Math.pow(10,Math.max(ot.getOptimalDecimals(this.candlesData.maxMinPrices[this.candlesData.chartTokenRef][this.candlesData.getChartIndicator()].min),ot.getOptimalDecimals(this.candlesData.maxMinPrices[this.candlesData.chartTokenRef][this.candlesData.getChartIndicator()].max)));h(he.getResolvedChartData(this._getUniquePairSymbol(),p,this.chartApiV2Adapter?"v2":"v1",this._hasSavedChartState(),this.pairSelected,this.chain,this.logo))})).subscribe(()=>this.chartLoader=!1)},searchSymbols:()=>{},subscribeBars:(u,h,p,m,A)=>{this._chartBarsSubscriptions.set(m,A),this._liveCandlesSub&&(this._liveCandlesSub.unsubscribe(),this._liveCandlesSub=null),this.latestCandles$&&(this._liveCandlesSub=this.latestCandles$.pipe(me(_=>_&&_.length>0)).subscribe(_=>{for(let x of _)p(x)}))},unsubscribeBars:u=>{this._chartBarsSubscriptions.delete(u),this._liveCandlesSub&&this._chartBarsSubscriptions.size===0&&(this._liveCandlesSub.unsubscribe(),this._liveCandlesSub=null),this.liveCandlesCleared.emit({candles:[]})}}}),this._cdRef.detectChanges(),this._tradingview.onChartReady(()=>{if(this.chartType!==null&&this._tradingview?.applyOverrides({"mainSeriesProperties.style":this.chartType}),this._tradingview?.chart().getPanes()[0].getMainSourcePriceScale()?.setAutoScale(!0),this._applyTvOverrides(),this.isResizable&&(this.showDragButton=!0,this._awaitChartHeightRequests()),this._tradingview){this.tvReady.next(this._tradingview),this._tradingview.applyOverrides({"scalesProperties.seriesLastValueMode":0}),this._tradingview.chart().onIntervalChanged().subscribe(null,p=>{setTimeout(()=>{let m=this.candlesData.resolution;["1","3","5"].includes(p)&&["15","1D","1440"].includes(m)&&console.warn(`Chart: interval changed to ${p} but candles resolution remains in ${m}. Perhaps the chart should be reset?`)},50)}),this._activeChart=this._tradingview.activeChart(),this._activeChart.onDataLoaded().subscribe(this,()=>{this._isFetchingCandles=!1}),this._activeChart.getTimezoneApi().onTimezoneChanged().subscribe(null,p=>{this._tradingview?.chart().refreshMarks()},!1);let h="onAutoSaveNeeded";this._tradingViewEventsSubscriptions.set(h,()=>{this._saveChartState()}),this._tradingview.subscribe(h,this._tradingViewEventsSubscriptions.get(h)),h="study",this._tradingViewEventsSubscriptions.set(h,()=>{this._saveChartState()}),this._tradingview.subscribe(h,this._tradingViewEventsSubscriptions.get(h)),this._saveChartState()}this.isResizable&&this.repositionVerticalResizeHandle(),this._cdRef.detectChanges()}),this._tradingview.headerReady().then(()=>{this._initCustomChartHeader(),this._cdRef.detectChanges()})},50)}}_applyTvOverrides(){let t=this._chartService.customBackgroundPlatformColor??(this.isDarkTheme?this._chartConfig.backgroundDark:this._chartConfig.backgroundLight);this._tradingview?._iFrame?.contentDocument?.documentElement.style.setProperty("--tv-color-platform-background",t);let e=this._chartService.customBackgroundPaneColor??(this.isDarkTheme?this._chartConfig.backgroundDark:this._chartConfig.backgroundLight);this._tradingview?._iFrame?.contentDocument?.documentElement.style.setProperty("--tv-color-pane-background",e)}_saveChartState(){if(this._tradingview?._iFrame?.contentWindow)try{this._storeChartSetting("latestResolution",this._tradingview.chart().resolution()),this._tradingview.save(t=>{this.isMulti&&(t.charts[0].chartId=this.pairSelected),this._chartState=JSON.parse(JSON.stringify(t)),this._storeChartSetting(this.chartSettingsStorage.savedStateKey,this._chartState)})}catch{console.warn("Invalid save chart state")}}_subscribeMaxMinPrices(){this._onResetChartData$.next(),this._minChart&&(this._minChart.innerHTML="Min: ---"),this._maxChart&&(this._maxChart.innerHTML="Max: ---"),this.candlesData?.maxMinPrices$.pipe(Ue(this._onResetChartData$),pe(this._destroyRef),me(()=>!!this.candlesData),R(t=>({symbol:this.candlesData.chartTokenRef==="usd"?"$":"",price:t[this.candlesData.chartTokenRef][this.candlesData.getChartIndicator()]}))).subscribe(({symbol:t,price:e})=>{if(this._maxChart&&e.max!=null){let i=ot.shortenPrice(e.max,e.max>=1?8:4);this._maxChart.innerHTML=`Max: ${t}${i}`}if(this._minChart&&e.min!=null){let i=ot.shortenPrice(e.min,e.min>=1?8:4);this._minChart.innerHTML=`Min: ${t}${i}`}})}_initCustomChartHeader(){if(!this._tradingview)return;if(this.showMarketCapButton){let n=this._tradingview.createButton();n.classList.add("btn-chg-price-mcap");let s=document.createElement("span");s.innerHTML="PRICE";let a=document.createElement("span");a.innerHTML="/";let o=document.createElement("span");o.innerHTML="MCAP",this.candlesData?.getChartIndicator()==="price"?(s.className="price active",o.className="mcap"):(o.className="mcap active",s.className="price"),n.append(s),n.append(a),n.append(o),Tt(n,"click").pipe(Ue(this.tvDestroyed),pe(this._destroyRef),H(()=>{if(!(this.chartLoader||this._isFetchingCandles)){if(this.chartLoader=!0,this._saveChartState(),this.candlesData){let l=this.candlesData.getChartIndicator();this.candlesData.setChartIndicator(l==="price"?"mcap":"price");let c=this.candlesData.getChartIndicator(),d=this._btnChangePriceMcap.querySelector(`.${l}`);d&&(d.className=l);let u=this._btnChangePriceMcap.querySelector(`.${c}`);u&&(u.className=`${c} active`)}this._resetChartData()}})).subscribe(),this._btnChangePriceMcap=n}if(this.showTokenRefChangeButton){let n=this._tradingview.createButton();n.innerHTML=this._getBtnChangeName(),n.classList.add("btn-chg-pair"),Tt(n,"click").pipe(Ue(this.tvDestroyed),pe(this._destroyRef),H(()=>{this.chartLoader||this._isFetchingCandles||(this.chartLoader=!0,this._saveChartState(),this.candlesData?.setChartTokenRef(this.candlesData?.chartTokenRef==="usd"?"eth":"usd"),this._resetChartData(),this._btnChange.innerHTML=this._getBtnChangeName())})).subscribe(),this._btnChange=n}this.showMinMaxButtons&&(this._maxChart=this._tradingview.createButton(),this._maxChart.classList.add("btn-max"),this._minChart=this._tradingview.createButton(),this._minChart?.classList.add("btn-min"),this._subscribeMaxMinPrices());let t=this._tradingview.createButton(),e=th,i=ih;if(this.showCandlesNormalizationIndicator!==void 0){let n=this._tradingview.createButton();n.innerHTML=nh,n.classList.add("btn-fullscreen","button-with-pointer"),n.setAttribute("title","Candle Normalization"),Tt(n,"click").pipe(Ue(this.tvDestroyed),pe(this._destroyRef),H(()=>{this.chartLoader=!0}),Wi(100),H(()=>{let s=n.classList.toggle("active");this.candleNormalizationToggled.emit({active:s}),this.chartLoader=!1})).subscribe(),this.showCandlesNormalizationIndicator&&n.classList.add("active")}if(this.showFillCandlesGapsIndicator!==void 0){let n=this._tradingview.createButton();n.innerHTML=rh,n.classList.add("btn-fullscreen"),n.classList.add("button-with-pointer"),n.setAttribute("title","Fill periods of inactivity"),Tt(n,"click").pipe(Ue(this.tvDestroyed),pe(this._destroyRef),H(()=>{this.chartLoader=!0}),Wi(100),H(()=>{let s=n.classList.toggle("active");this.fillTheGapsToggled.emit({active:s}),this.chartLoader=!1})).subscribe(),this.showFillCandlesGapsIndicator&&n.classList.add("active")}this.isMulti?(t.innerHTML=i,t.parentElement?.parentElement?.classList.add("hide")):t.innerHTML=e,t.setAttribute("title","Fullscreen mode"),t.classList.add("btn-fullscreen"),t.classList.add("apply-common-tooltip"),Tt(t,"click").pipe(Ue(this.tvDestroyed),pe(this._destroyRef),H(()=>{this.chartLoader=!0}),Wi(300),H(()=>{this.toggleFullChart(),this.isMulti?this._btnFull.innerHTML=i:this._btnFull.innerHTML=this.isFullscreenChart?i:e,this.chartLoader=!1})).subscribe(),setTimeout(()=>{this._btnFull=t},10)}_getUniquePairSymbol(){let t=this._pairSymbols.get(this.tokenData.symbol)||[],e=t.indexOf(this.pairSelected);return e===-1&&(t.push(this.pairSelected),this._pairSymbols.set(this.tokenData.symbol,t),e=t.length-1),this._getChartSymbol(e)}_getChartSymbol(t){return`${this.tokenData.symbol+"\u200B".repeat(t)}/${he.getChartTokenRef(this.tokenData.isStableSymbol,this.refTokenSymbol,this.candlesData?.chartTokenRef,!0)}${this._getMcapSymbol()} - ${this.exchange.slice(0,3).toUpperCase()}`}_getMcapSymbol(){return this.candlesData?.getChartIndicator()==="mcap"?"(Market Cap) ":""}_checkRenameNewCharts(){let t=ne.get(Ts)??{};ne.setCompressed(fg,t),ne.setCompressed(mg,t);try{if(t?.charts?.[0]){let e=t.charts[0];if(e?.panes[0]){let i=e.panes[0];i?.sources.length>0&&(i.sources=i.sources.map(n=>{let s=f({},n);for(let a in s)a==="state"&&s[a].symbol&&(s[a].symbol=s[a].symbol.replace(/ {2}- /g," - "),s[a].symbol=s[a].symbol.replace(/(.*)(\s-\s\w{3})\s-\s(.+)$/g,"$3:$1$2"),this._hasSavedChartState.set(!0));return s}))}ne.set(Ts,t)}ne.set(ph,!0),ne.set(mh,!0),ne.delete(pg)}catch(e){console.error("TradingView chart: error while renaming charts",e)}}_getBtnChangeName(){return`${this.tokenData.symbol}/${he.getChartTokenRef(this.tokenData.isStableSymbol,this.refTokenSymbol,this.candlesData?.chartTokenRef)}`}toggleFullChart(){this.isFullscreenChart=!this.isFullscreenChart,this.isMulti&&(this.isFullscreenChart?this._btnFull?.parentElement?.parentElement?.classList.remove("hide"):this._btnFull?.parentElement?.parentElement?.classList.add("hide")),this.fullScreenToggled.emit()}_updateTVClasses(){if(this._tradingview?._iFrame?.parentElement){let t=this._tradingview._iFrame.parentElement;if(this.chartLoader)this._renderer.addClass(t,"loading-pair");else{let i=this.tradingViewContainer.nativeElement.closest(".trading-view")?.querySelector(".dxt-loading");i&&(i.style.display="none"),this._renderer.removeClass(t,"loading-pair")}this.isFullscreenChart?this._renderer.addClass(t,"fullscreen"):this._renderer.removeClass(t,"fullscreen")}}_resetChartData(t){this.chartLoader=!0,this._tradingview&&(this._loadedApiResolutions=[],this._tradingview.chart().clearMarks(),this._tradingview.setSymbol(this._getUniquePairSymbol(),this._getStoredChartSetting("latestResolution"),()=>{this.liveCandlesCleared.emit({candles:[]}),this._tradingview&&(this.chartLoader=!1,this._tradingview.chart().refreshMarks()),t?.()}))}_getStoredChartSetting(t){return this.chartSettingsStorage.getStoredSetting(t,this.isMulti,this.pairSelected)}_storeChartSetting(t,e){this.chartSettingsStorage.storeSetting(t,e,this.isMulti,this.pairSelected)}dragMove(){this.isResizable&&this._ngZone.runOutsideAngular(()=>{if(this.dragHandleBottom&&this.resizableBox){let t=this.dragHandleBottom.nativeElement.getBoundingClientRect(),e=this.resizableBox.nativeElement.getBoundingClientRect(),i=t.top-e.top+t.height,n=i<=200?"200px":`${i}px`;this.resizableBox.nativeElement.style.height=n,this._storeChartHeight$.next(n),this.repositionVerticalResizeHandle()}})}toggleOverlay(t){this.showOverlay=t}repositionVerticalResizeHandle(){if(this.resizableBox&&this.dragHandleBottom){let t=this.resizableBox.nativeElement.getBoundingClientRect(),e=this.dragHandleBottom.nativeElement.getBoundingClientRect(),i=t.height-e.height;this.dragHandleBottom.nativeElement.style.transform=`translate(0, ${i}px)`}}_awaitChartHeightRequests(){this._storeChartHeight$.pipe(pe(this._destroyRef),Cr(()=>Pe(1e3))).subscribe(t=>{this._storeChartSetting("resizedHeight",t)})}_manageCandles(t,e,i,n,s,a){let o=e.getImmediateSupportedApiResolution(he.transformToNumericResolution(this._tradingview?.chart().resolution()));e.setResolution(o);let l=!1;if(this._loadedApiResolutions.includes(o)||(l=!0,this._loadedApiResolutions.push(o)),this._tradingview){let m=this._tradingview.chart();this._storeChartSetting("latestResolution",`${m.resolution()}`)}let c=C({rawCandles:{version:void 0,symbol:e.chartTokenRef,candles:[],oldestTs:-1},requests:[]}),d=C({rawCandles:{version:void 0,symbol:e.chartTokenRef,candles:[],oldestTs:-1},requests:[]}),u=s,h=!1;this._isFetchingCandles=!0;let p=e.getFirstCandleStartingFrom(n,o);p?(d=$e(this._candlesDataService.getCandles(e,p.time,s,o)).pipe(R(m=>({rawCandles:{version:e.historyVersion,symbol:e.chartTokenRef,candles:m,oldestTs:-1},requests:[]}))),p.time>n&&(u=p.time-Wt,h=!0)):h=!0,h&&this.pairSelected&&(c=this._chartService.getCandles(t,this.pairSelected,e.chartTokenRef,o,n,u,this.chain,e.historyVersion,e.oldestTsInApi,e.getOldestTsInChart(o),e.getOldestTsRequestedToApi(o),l).pipe(ie(1),H(_=>se(this,[_],function*({rawCandles:m,requests:A}){e.setHistoryVersion(m.version),e.setOldestTsInApi(m.oldestTs),A[A.length-1]&&e.setOldestTsRequestedToApi(o,A[A.length-1]?.startTs),m.candles&&m.candles.length>0&&(yield this._candlesDataService.addCandles(e,m,o,this.normalizeCandles,this.tokenData.supply))})),vr(({rawCandles:m})=>{let A=Xe(250);return m.candles.length>1e5?A=Xe(4e3):m.candles.length>2e4&&(A=Xe(2500)),A.pipe(ie(1))}))),Dn(c,d).subscribe(A=>se(this,[A],function*([m]){this.chartLoader=!1;let _=yield this._candlesDataService.getCandlesForChart(e,n,s,o,a,this.fillCandlesGaps,e.getOldestTsInChart(o));if(_.length>0)e.setOldestTsInChart(o,_[0].time),_.length-a>5&&console.log(`Candles: returned more candles than requested. Requested ${a} vs returned ${_.length}`),i(_,{noData:!1});else if(m.rawCandles.oldestTs&&m.rawCandles.oldestTs!==-1&&n>m.rawCandles.oldestTs){let x=n-Fe*30;this._chartService.getCandles(t,this.pairSelected,e.chartTokenRef,o,x,n,this.chain,e.historyVersion,e.oldestTsInApi,e.getOldestTsInChart(o),e.getOldestTsRequestedToApi(o),l).pipe(ie(1)).subscribe(Y=>se(this,[Y],function*({rawCandles:k,requests:U}){U[U.length-1]&&e.setOldestTsRequestedToApi(o,U[U.length-1]?.startTs),k.candles&&k.candles.length>0&&(yield this._candlesDataService.addCandles(e,k,o,this.normalizeCandles,this.tokenData.supply));let oe=yield this._candlesDataService.getCandlesForChart(e,x,n,o,a,this.fillCandlesGaps,e.getOldestTsInChart(o));oe.length>0?(e.setOldestTsInChart(o,oe[0].time),i(oe,{noData:!1})):i([],{noData:!0,nextTime:Math.round(x/1e3)})}))}else i([],{noData:!0})}))}_manageCandlesV2(t,e,i,n,s,a){let o=e.getImmediateSupportedApiResolution(he.transformToNumericResolution(this._tradingview?.chart().resolution()));e.setResolution(o);let l=e.getOldestTsInApiByResolution(o),c=!1;if(this._loadedApiResolutions.includes(o)||(c=!0,this._loadedApiResolutions.push(o)),this._tradingview){let p=this._tradingview.chart();this._storeChartSetting("latestResolution",p.resolution())}let d=C({rawCandles:{symbol:e.chartTokenRef,candles:[]},requestedSpan:e.getOptimalSpan(o)});this._isFetchingCandles=!0;let u=e.getFirstCandleStartingFrom(n,o);(!u||u.time>n)&&this.pairSelected&&(d=this._chartService.getCandlesV2(t,this.pairSelected,e.chartTokenRef,o,n,s,this.chain,e.getOptimalSpan(o),e.getNextTsRequestToApi(o),e.oldestTsInApi,c,l).pipe(ie(1),H(A=>se(this,[A],function*({rawCandles:p,requestedSpan:m}){e.oldestTsInApi||e.setOldestTsInApi(p.oldestTs),e.setNextTsRequestToApi(o,p.nextTs);let _=m?he.getAdjustedSpanForCandleDensity(m,o,p.candles.length):void 0;(!e.getOptimalSpan(o)&&_||_&&m!==_)&&e.setOptimalSpan(o,_),p.candles.length>0&&(yield this._candlesDataService.addCandles(e,p,o,this.normalizeCandles,this.tokenData.supply))})),vr(({rawCandles:p})=>{let m=Xe(250);return p.candles.length>1e5?m=Xe(4e3):p.candles.length>2e4&&(m=Xe(2500)),m.pipe(ie(1))}))),d.subscribe(()=>se(this,null,function*(){let p=e.getNextTsRequestToApi(o),m=yield this._candlesDataService.getCandlesForChart(e,n,s,o,a,this.fillCandlesGaps,e.getOldestTsInChart(o));m.length>0?(e.setOldestTsInChart(o,m[0].time),m.length-a>5&&console.log(`Candles: returned more candles than requested. Requested ${a} vs returned ${m.length}`),i(m,{noData:!1})):e.oldestTsInApi&&s>=e.oldestTsInApi&&p&&p>e.oldestTsInApi&&(!l||s>=l&&p>l)?i([],{noData:!0,nextTime:Math.round(p/1e3)}):i([],{noData:!0}),this.chartLoader=!1,this._cdRef.detectChanges()}))}_manageCandlesV3(t,e,i,n,s,a){let o=e.getImmediateSupportedApiResolution(he.transformToNumericResolution(this._tradingview?.chart().resolution()));e.setResolution(o);let l=e.getOldestTsInApiByResolution(o),c=!1;if(this._loadedApiResolutions.includes(o)||(c=!0,this._loadedApiResolutions.push(o)),this._tradingview){let p=this._tradingview.chart();this._storeChartSetting("latestResolution",p.resolution())}let d=C({rawCandles:{symbol:e.chartTokenRef,candles:[]},requestedSpan:e.getOptimalSpan(o)});this._isFetchingCandles=!0;let u=e.getFirstCandleStartingFrom(n,o);(!u||u.time>n)&&this.pairSelected&&(d=this._chartService.getCandlesV3(t,this.pairSelected,e.chartTokenRef,o,a,n,s,this.chain,e.getNextTsRequestToApi(o),e.oldestTsInApi,c,l).pipe(ie(1),H(A=>se(this,[A],function*({rawCandles:p,requestedSpan:m}){e.oldestTsInApi||e.setOldestTsInApi(p.oldestTs),e.setNextTsRequestToApi(o,p.nextTs);let _=m?he.getAdjustedSpanForCandleDensity(m,o,p.candles.length):void 0;(!e.getOptimalSpan(o)&&_||_&&m!==_)&&e.setOptimalSpan(o,_),p.candles.length>0&&(yield this._candlesDataService.addCandles(e,p,o,this.normalizeCandles,this.tokenData.supply))})),vr(({rawCandles:p})=>{let m=Xe(250);return p.candles.length>1e5?m=Xe(4e3):p.candles.length>2e4&&(m=Xe(2500)),m.pipe(ie(1))}))),d.subscribe(()=>se(this,null,function*(){let p=e.getNextTsRequestToApi(o),m=yield this._candlesDataService.getCandlesForChart(e,n,s,o,a,this.fillCandlesGaps,e.getOldestTsInChart(o));m.length>0?(e.setOldestTsInChart(o,m[0].time),m.length-a>5&&console.log(`Candles: returned more candles than requested. Requested ${a} vs returned ${m.length}`),i(m,{noData:!1})):e.oldestTsInApi&&s>=e.oldestTsInApi&&p&&p>e.oldestTsInApi&&(!l||s>=l&&p>l)?i([],{noData:!0,nextTime:Math.round(p/1e3)}):i([],{noData:!0}),this.chartLoader=!1,this._cdRef.detectChanges()}))}static{this.\u0275fac=function(e){return new(e||r)(S(In),S(bt),S(Dt),S(Pr),S(Re),S(Ne),S(ht),S(bn),S(as),S(Fi,8))}}static{this.\u0275cmp=Q({type:r,selectors:[["app-trading-view"]],contentQueries:function(e,i,n){if(e&1&&(rt(n,vs,5),rt(n,bs,5)),e&2){let s;Te(s=we())&&(i.disclaimerSlot=s.first),Te(s=we())&&(i.dragIconSlot=s.first)}},viewQuery:function(e,i){if(e&1&&(Rt(tg,5),Rt(ig,5),Rt(ng,5)),e&2){let n;Te(n=we())&&(i.tradingViewContainer=n.first),Te(n=we())&&(i.resizableBox=n.first),Te(n=we())&&(i.dragHandleBottom=n.first)}},inputs:{refTokenSymbol:"refTokenSymbol",chartApiAdapter:"chartApiAdapter",chartApiV2Adapter:"chartApiV2Adapter",exchange:"exchange",chain:"chain",tokenData:"tokenData",normalizeCandles:"normalizeCandles",showCandlesNormalizationIndicator:"showCandlesNormalizationIndicator",fillCandlesGaps:"fillCandlesGaps",showFillCandlesGapsIndicator:"showFillCandlesGapsIndicator",candlesData:"candlesData",latestCandles$:"latestCandles$",pairSelected:"pairSelected",logo:"logo",defaultFavorites:"defaultFavorites",countSwapsLast24h:"countSwapsLast24h",selectedTransactions:"selectedTransactions",selectedPositions:"selectedPositions",avgPrice:"avgPrice",disclaimer:"disclaimer",userAccess:"userAccess",darkThemeUrl:"darkThemeUrl",lightThemeUrl:"lightThemeUrl",chartResolution:"chartResolution",chartType:"chartType",chartSettingsStorage:"chartSettingsStorage",clientId:"clientId",isFullScreen:"isFullScreen",isDarkTheme:"isDarkTheme",isMulti:"isMulti",isResizable:"isResizable",allowMarksOnBars:"allowMarksOnBars",allowTimescaleMarksOnBars:"allowTimescaleMarksOnBars",isUserIdEnabled:"isUserIdEnabled",showTokenRefChangeButton:"showTokenRefChangeButton",showMarketCapButton:"showMarketCapButton",showMinMaxButtons:"showMinMaxButtons",showLeftToolbar:"showLeftToolbar",secondsResolutionsEnabled:"secondsResolutionsEnabled",extraMarks:[1,"extraMarks"]},outputs:{liveCandlesCleared:"liveCandlesCleared",tvDestroyed:"tvDestroyed",fullScreenToggled:"fullScreenToggled",candleNormalizationToggled:"candleNormalizationToggled",fillTheGapsToggled:"fillTheGapsToggled",tvReady:"tvReady"},standalone:!0,features:[zt([{provide:bt,useFactory:hg,deps:[et,Fi]}]),nt,ue],decls:7,vars:7,consts:[["resizableBox",""],["tradingview",""],["dragHandleBottom",""],[1,"trading-view",3,"ngClass"],[1,"trading-view__overlay"],["cdkDrag","","cdkDragLockAxis","y",1,"trading-view__drag-handle","bottom",3,"ngClass"],[1,"trading-view__container",3,"hidden"],["cdkDrag","","cdkDragLockAxis","y",1,"trading-view__drag-handle","bottom",3,"cdkDragMoved","cdkDragStarted","cdkDragReleased","mousedown","mouseup","ngClass"],[4,"ngTemplateOutlet"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,i){e&1&&(F(0,"div",3,0),$(2,og,1,0,"div",4)(3,cg,3,4,"span",5),X(4,"div",6,1),$(6,ug,1,4,"ng-container"),O()),e&2&&(v("ngClass",st(5,rg,i.isResizable)),I(2),wt(i.isResizable&&i.showOverlay?2:-1),I(),wt(i.isResizable?3:-1),I(),v("hidden",!i.tokenData||!i.tokenData.symbol),I(2),wt(i.disclaimer?6:-1))},dependencies:[Ju,xt,Yt,Iu],encapsulation:2,changeDetection:0})}};var Es=class r{static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275cmp=Q({type:r,selectors:[["app-root"]],standalone:!0,features:[ue],decls:1,vars:0,template:function(e,i){e&1&&X(0,"router-outlet")},dependencies:[co],encapsulation:2,changeDetection:0})}};var gg=["*",[["p-header"]],[["p-footer"]]],_g=["*","p-header","p-footer"];function Cg(r,t){r&1&&Ye(0)}function vg(r,t){if(r&1&&(F(0,"div",8),Qe(1,1),$(2,Cg,1,0,"ng-container",6),O()),r&2){let e=w();I(2),v("ngTemplateOutlet",e.headerTemplate)}}function bg(r,t){r&1&&Ye(0)}function yg(r,t){if(r&1&&(F(0,"div",9),Ee(1),$(2,bg,1,0,"ng-container",6),O()),r&2){let e=w();I(),jt(" ",e.header," "),I(),v("ngTemplateOutlet",e.titleTemplate)}}function Sg(r,t){r&1&&Ye(0)}function Ig(r,t){if(r&1&&(F(0,"div",10),Ee(1),$(2,Sg,1,0,"ng-container",6),O()),r&2){let e=w();I(),jt(" ",e.subheader," "),I(),v("ngTemplateOutlet",e.subtitleTemplate)}}function Tg(r,t){r&1&&Ye(0)}function wg(r,t){r&1&&Ye(0)}function Eg(r,t){if(r&1&&(F(0,"div",11),Qe(1,2),$(2,wg,1,0,"ng-container",6),O()),r&2){let e=w();I(2),v("ngTemplateOutlet",e.footerTemplate)}}var fh=(()=>{class r{el;header;subheader;set style(e){be.equals(this._style(),e)||this._style.set(e)}styleClass;headerFacet;footerFacet;templates;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_style=Me(null);constructor(e){this.el=e}ngAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"header":this.headerTemplate=e.template;break;case"title":this.titleTemplate=e.template;break;case"subtitle":this.subtitleTemplate=e.template;break;case"content":this.contentTemplate=e.template;break;case"footer":this.footerTemplate=e.template;break;default:this.contentTemplate=e.template;break}})}getBlockableElement(){return this.el.nativeElement.children[0]}static \u0275fac=function(i){return new(i||r)(S(Ie))};static \u0275cmp=Q({type:r,selectors:[["p-card"]],contentQueries:function(i,n,s){if(i&1&&(rt(s,hu,5),rt(s,pu,5),rt(s,mi,4)),i&2){let a;Te(a=we())&&(n.headerFacet=a.first),Te(a=we())&&(n.footerFacet=a.first),Te(a=we())&&(n.templates=a)}},hostAttrs:[1,"p-element"],inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},ngContentSelectors:_g,decls:9,vars:10,consts:[[3,"ngClass","ngStyle"],["class","p-card-header",4,"ngIf"],[1,"p-card-body"],["class","p-card-title",4,"ngIf"],["class","p-card-subtitle",4,"ngIf"],[1,"p-card-content"],[4,"ngTemplateOutlet"],["class","p-card-footer",4,"ngIf"],[1,"p-card-header"],[1,"p-card-title"],[1,"p-card-subtitle"],[1,"p-card-footer"]],template:function(i,n){i&1&&(mt(gg),F(0,"div",0),$(1,vg,3,1,"div",1),F(2,"div",2),$(3,yg,3,2,"div",3)(4,Ig,3,2,"div",4),F(5,"div",5),Qe(6),$(7,Tg,1,0,"ng-container",6),O(),$(8,Eg,3,1,"div",7),O()()),i&2&&(We(n.styleClass),v("ngClass","p-card p-component")("ngStyle",n._style()),Z("data-pc-name","card"),I(),v("ngIf",n.headerFacet||n.headerTemplate),I(2),v("ngIf",n.header||n.titleTemplate),I(),v("ngIf",n.subheader||n.subtitleTemplate),I(3),v("ngTemplateOutlet",n.contentTemplate),I(),v("ngIf",n.footerFacet||n.footerTemplate))},dependencies:[xt,Ri,Yt,xi],styles:[`@layer primeng{.p-card-header img{width:100%}} `],encapsulation:2,changeDetection:0})}return r})(),gh=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275mod=Ce({type:r});static \u0275inj=_e({imports:[Xi,ti]})}return r})();var jo="Unknown",Vi=["is_open_source","is_honeypot","buy_tax","sell_tax","is_proxy","is_mintable","slippage_modifiable","transfer_pausable","is_blacklisted","is_potentially_scam","can_take_back_ownership","owner_change_balance","hidden_owner","selfdestruct","external_call","cannot_buy","cannot_sell_all","is_whitelisted","is_anti_whale","anti_whale_modifiable","trading_cooldown","personal_slippage_modifiable","is_true_token","is_airdrop_scam","trust_list","owner_address","owner_balance","owner_percent","creator_address","creator_balance","creator_percent","lp_holder_count","other_potential_risks","note"],zo=["quickintel","tokensniffer","goplus","honeypotis"],hr={goplus:"https://gopluslabs.io/token-security",tokensniffer:"https://tokensniffer.com/token",quickintel:"https://app.quickintel.io/scanner",honeypotis:"https://honeypot.is"},Wo={arbitrum:{goplus:y.getChainData("arbitrum").id,tokensniffer:"arb",quickintel:"arbitrum"},avalanche:{goplus:y.getChainData("avalanche").id,tokensniffer:"avax",quickintel:"avalanche"},base:{goplus:y.getChainData("base").id,tokensniffer:"base",quickintel:"base",honeypotis:"base"},bnb:{goplus:y.getChainData("bnb").id,tokensniffer:"bsc",quickintel:"bsc",honeypotis:"bsc"},bitrock:{quickintel:"bitrock"},blast:{goplus:y.getChainData("blast").id,quickintel:"blast"},canto:{quickintel:"canto"},conflux:{quickintel:"conflux"},coredao:{quickintel:"core"},cronos:{goplus:y.getChainData("cronos").id,tokensniffer:"cronos"},energi:{quickintel:"energi"},ether:{goplus:y.getChainData("ether").id,tokensniffer:"eth",quickintel:"eth",honeypotis:"ethereum"},ethw:{goplus:y.getChainData("ethw").id},fantom:{goplus:y.getChainData("fantom").id,tokensniffer:"ftm",quickintel:"fantom"},gnosis:{goplus:y.getChainData("gnosis").id,tokensniffer:"xdai"},kava:{quickintel:"kava"},kucoin:{goplus:y.getChainData("kucoin").id,tokensniffer:"kcc"},linea:{goplus:y.getChainData("linea").id,quickintel:"linea"},mantle:{goplus:y.getChainData("mantle").id},metis:{quickintel:"metis"},oktc:{goplus:y.getChainData("oktc").id},opbnb:{quickintel:"opbnb"},optimism:{goplus:y.getChainData("optimism").id,tokensniffer:"opt"},polygon:{goplus:y.getChainData("polygon").id,tokensniffer:"poly",quickintel:"polygon"},polygonzkevm:{quickintel:"polygonzkevm"},pulse:{quickintel:"pulse"},shibarium:{quickintel:"shibarium"},solana:{quickintel:"solana"},tron:{goplus:"tron"},zksync:{goplus:y.getChainData("zksync").id,quickintel:"zksync"},abstract:{quickintel:"abstract"},berachain:{goplus:y.getChainData("berachain").id},sui:{goplus:y.getChainData("sui").chain}},_h="dextools";var Go=["ethereum","bnb","polygon","fantom","cronos","avalanche","metis","kucoin","optimism","arbitrum","celo","telos","moonbeam","fuse","oktc","solana","dogechain","canto","etc","gnosis","arbitrumnova","songbird","conflux","elastos","ronin","viction","kava","ethw","alvey","aptos","multiversx","flare","pom","ultron","energi","coredao","zksync","polygonzkevm","pulse","kaia","linea","base","mantle","bitrock","opbnb","shibarium","scroll","manta","kujira","blast","osmosis","xlayer","mode","ton","hedera","near","tron","bitlayer","apechain","elysium","cronoszkevm","iotaevm","worldchain","chiliz","icp","xrpl","sonic","ink","xdc","abstract","pawchain","berachain","unichain","units","soneium","hyperevm","sui","vsc","story","odyssey","gravityalpha","shido","superseed","etherlink","utwou","nibiruevm","sei","plasma","qubic","monad"],Ko=[["ethereum",3030],["bnb",3040],["polygon",3050],["fantom",3070],["cronos",3080],["avalanche",3090],["metis",3120],["kucoin",3120],["optimism",3120],["arbitrum",3120],["celo",3120],["telos",3120],["moonbeam",3120],["fuse",3120],["oktc",3120],["solana",3120],["dogechain",3120],["canto",3120],["etc",3120],["gnosis",3120],["arbitrumnova",3120],["songbird",3120],["conflux",3120],["elastos",3120],["ronin",3120],["viction",3120],["kava",3120],["ethw",3120],["alvey",3120],["aptos",3120],["multiversx",3120],["flare",3120],["pom",3120],["ultron",3120],["energi",3120],["coredao",3120],["zksync",3120],["polygonzkevm",3120],["pulse",3120],["kaia",3120],["linea",3120],["base",3120],["mantle",3120],["bitrock",3120],["opbnb",3120],["shibarium",3120],["scroll",3120],["manta",3120],["kujira",3120],["blast",3120],["osmosis",3120],["xlayer",3120],["mode",3120],["ton",3120],["hedera",3120],["near",3120],["tron",3120],["bitlayer",3120],["apechain",3120],["elysium",3120],["cronoszkevm",3120],["iotaevm",3120],["worldchain",3120],["chiliz",3120],["icp",3120],["xrpl",3120],["sonic",3120],["ink",3120],["xdc",3120],["abstract",3120],["pawchain",3120],["berachain",3120],["unichain",3120],["units",3120],["soneium",3120],["hyperevm",3120],["sui",3120],["vsc",3120],["story",3120],["odyssey",3120],["gravityalpha",3120],["shido",3120],["superseed",3120],["etherlink",3120],["utwou",3120],["nibiruevm",3120],["sei",3120],["plasma",3120],["qubic",3120],["monad",3120]];var Ch="unicrypt";var As="teamfinance",Rs="team-finance",qo="fair-token-project",xs="dxsale",Ds="pinksale",Ls="mudra",ks="floki",Ps="gempad",Os="soltools",Ms="ref-finance",Ns="unvest";var Zo={ether:L.Ethereum.id.toString(),cronos:L.Cronos.id.toString(),bnb:L.Binance.id.toString(),oktc:L.Oktc.id.toString(),gnosis:L.Gnosis.id.toString(),shibarium:L.Shibarium.id.toString(),polygon:L.Polygon.id.toString(),fantom:L.Fantom.id.toString(),kucoin:L.Kucoin.id.toString(),zksync:L.Zksync.id.toString(),pulse:L.Pulse.id.toString(),coredao:L.CoreDao.id.toString(),dogechain:L.Doge.id.toString(),alvey:L.Alvey.id.toString(),base:L.Base.id.toString(),arbitrum:L.Arbitrum.id.toString(),celo:L.Celo.id.toString(),avalanche:L.Avalanche.id.toString(),blast:L.Blast.id.toString()},Xo={ether:"ethereum",bnb:"bsc",polygon:"polygon",avalanche:"avalanche",fantom:"fantom",dogechain:"dogechain",cronos:"cronos",arbitrum:"arbitrum",alvey:"alvey",pulse:"pulsechain",base:"base",solana:"solana"},vh={solana:L.Solana.chain},Fs={ether:L.Ethereum.id.toString(),optimism:L.Optimism.id.toString(),cronos:L.Cronos.id.toString(),bnb:L.Binance.id.toString(),oktc:L.Oktc.id.toString(),polygon:L.Polygon.id.toString(),fantom:L.Fantom.id.toString(),kucoin:L.Kucoin.id.toString(),dogechain:L.Doge.id.toString(),arbitrum:L.Arbitrum.id.toString(),avalanche:L.Avalanche.id.toString(),base:L.Base.id.toString()},bh={ether:"ETH",bnb:"BNB",polygon:"Polygon",arbitrum:"Arbitrum",avalanche:"Avalanche",base:"Base",solana:"Solana"},Yo={ether:L.Ethereum.hexId,bnb:L.Binance.hexId,cronos:L.Cronos.hexId,etc:L.Etc.hexId,polygon:L.Polygon.hexId,fantom:L.Fantom.hexId,kava:L.Kava.hexId,avalanche:L.Avalanche.hexId,base:L.Base.hexId,blast:L.Blast.hexId},Qo={ether:L.Ethereum.hexId,bnb:L.Binance.hexId,polygon:L.Polygon.hexId,base:L.Base.hexId,arbitrum:L.Arbitrum.id.toString(),avalanche:L.Avalanche.id.toString(),blast:L.Blast.hexId,optimism:L.Optimism.id.toString()},yh={ether:L.Ethereum.id,bnb:L.Binance.id,cronos:L.Cronos.id,telos:L.Telos.id,polygon:L.Polygon.id,fantom:L.Fantom.id,dogechain:L.Doge.id,alvey:L.Alvey.id,arbitrum:L.Arbitrum.id,shibarium:L.Shibarium.id,base:L.Base.id,solana:L.Solana.id},Sh={near:L.Near.id};var Ih={ether:"eth",bnb:"bsc",avalanche:"avax",fantom:"ftm",cronos:"cro",arbitrum:"arbi",polygon:"poly",base:"base",solana:"sol"};var S2=new RegExp(".*/token/.*");var Th="/data/pair",wh="/data/token";var Vs="memeboard";var Eh="https://www.dextools.io/resources/tokens/logos/";var Jo=/yes/i,Ah=/no/i,Rh=8,xh=20,$s=class r{static mapAudits(t,e){let i=t.token.audit.external&&e.contractAuditSupported?r._mapExternalAudits(t.token.audit,t.id,e.chain):void 0;return t.token.audit?j(f({},t.token.audit),{external:i,dextools:r._mapDextoolsAudits(t.token.audit),totalAlerts:i?r._getTotalAlerts(i):void 0,isFromTokenCreator:t.token.deployment?.provider==="dextools",summary:t.token.audit.dextools?t.token.audit.dextools.summary:void 0}):void 0}static _mapExternalAudits(t,e,i){let n={};for(let s of zo){let a=t.external[s],o=t.external.config?.[s]?.ignored;if(a&&Wo[i]?.[s]&&!o){let l=!!a.is_contract_renounced,c={},d=t.external,u=Object.entries(a).filter(([h])=>Vi.includes(h));for(let[h,p]of u)c[h]={name:h,value:r._getAuditValue(h,p),color:r._selectAuditColor(h,p,!!a.is_contract_renounced),icon:r._selectAuditIcon(h,p,!!a.is_contract_renounced)};this._newSelectAuditColor(d,c,s,l),r._addMissingTaxKeys(c),Object.values(c).sort((h,p)=>Vi.indexOf(h.name)-Vi.indexOf(p.name)),Object.keys(c).length>0&&(n[s]={alerts:r._getAuditAlerts(c),provider:s,url:r._getAuditProviderUrl(s,i,e),image:r._getAuditProviderLogo(s),holders:a.holders?r._mapHolders(a.holders):[],holdersCount:a.holder_count??0,data:c})}}return n}static _mapDextoolsAudits(t){let e={},i=t.dextools;if(i){let n={};for(let[s,a]of Object.entries(i).filter(([o])=>Vi.includes(o))){let o=i.is_contract_renounced==="yes";n[s]={name:s,value:r._getDextoolsAuditValue(s,a),color:r._selectAuditColor(s,a,o,!0),icon:r._selectAuditIcon(s,a,o,!0)}}r._addMissingTaxKeys(n),Object.values(n).sort((s,a)=>Vi.indexOf(s.name)-Vi.indexOf(a.name)),Object.keys(n).length>0&&(e={provider:_h,data:n})}return e}static _addMissingTaxKeys(t){let e=["buy_tax","sell_tax"];for(let i of e)Object.values(t).some(({name:n})=>n===i)||(t[i]={name:i,value:jo,color:"unknown",icon:"unknown"})}static _mapHolders(t){return t.map(e=>({address:e.address,supplyPercent:Number((e.percent*100).toFixed(2)),amount:Number(Number(e.balance).toFixed(2))}))}static _selectAuditColor(t,e,i,n){switch(t){case"is_honeypot":case"is_proxy":case"can_take_back_ownership":case"hidden_owner":case"selfdestruct":case"external_call":case"cannot_buy":case"cannot_sell_all":case"is_anti_whale":case"trading_cooldown":case"other_potential_risks":case"is_potentially_scam":return r._getType(t,e,!1,n);case"is_mintable":case"owner_change_balance":case"slippage_modifiable":case"transfer_pausable":case"anti_whale_modifiable":case"is_blacklisted":case"is_whitelisted":case"personal_slippage_modifiable":return r._getTypeByOwnership(t,e,!1);case"is_open_source":case"is_true_token":case"trust_list":return r._getType(t,e,!0);case"buy_tax":case"sell_tax":return r._getTaxType(e);default:return"unknown"}}static _newSelectAuditColor(t,e,i,n){let s=Object.keys(t).filter(a=>zo.includes(a));for(let a of s){let o=t[a]?.summary;if(!o)continue;let l=o;"providers"in o&&(l=o.providers);for(let c in l){let d=c,u=l[c];if(Object.keys(u).length>0){for(let h of u)if(h in e&&i===a)switch(h){case"is_mintable":case"owner_change_balance":case"slippage_modifiable":case"transfer_pausable":case"anti_whale_modifiable":case"is_blacklisted":case"is_whitelisted":case"personal_slippage_modifiable":{e[h].color=this._determineColor(d,n),e[h].icon=this._determineColor(d,n);break}default:e[h].color=this._determineColor(d,!1)}}}}}static _determineColor(t,e){return{warning:"warning",critical:"negative",regular:e?"info":"unknown"}[t]||"positive"}static _selectAuditIcon(t,e,i,n){switch(t){case"is_proxy":case"can_take_back_ownership":case"hidden_owner":case"selfdestruct":case"external_call":case"cannot_buy":case"cannot_sell_all":case"is_honeypot":case"is_anti_whale":case"trading_cooldown":case"is_airdrop_scam":case"is_potentially_scam":case"other_potential_risks":return r._getType(t,e,!1,n);case"is_mintable":case"owner_change_balance":case"slippage_modifiable":case"transfer_pausable":case"anti_whale_modifiable":case"is_blacklisted":case"is_whitelisted":case"personal_slippage_modifiable":return r._getTypeByOwnership(t,e,!1);case"note":return"negative";case"is_open_source":return e==1||Jo.test(e)?"safe":"unsafe";case"is_true_token":case"trust_list":return r._getType(t,e,!0);case"buy_tax":case"sell_tax":return r._getTaxType(e);default:return}}static _getAuditValue(t,e){return e!=null&&e!==""?["sell_tax","buy_tax","owner_percent","creator_percent"].includes(t)?`${e*100}`:["owner_address","owner_balance","creator_address","creator_balance","lp_holder_count","note"].includes(t)?`${e}`:Jo.test(e)||Ah.test(e)?`${e}`:t.includes("is_potentially_scam")?e?"detected":"undetected":e==1?"Yes":"No":jo}static _getDextoolsAuditValue(t,e){if(t==="buy_tax"||t==="sell_tax"){let i="unknown",n="unknown",s=e;return s.status!=="unknown"&&(i=`${Number((s.min*100).toFixed(2))}%`,n=`${Number((s.max*100).toFixed(2))}%`),i===n?`${n}`:`${i} - ${n}`}return t.includes("is_potentially_scam")?this._isMatch(e,!1)?"undetected":"detected":`${e}`}static _isBanned(t){return["is_honeypot"].includes(t)}static _isMatch(t,e=!1){let i=e?Jo:Ah;return(e?t==1:t==0)||i.test(t)}static _getType(t,e,i=!1,n=!1){return t.includes("is_potentially_scam")?n?this._isMatch(e,i)?"unknown":"negative":e?"negative":"unknown":r._isMatch(e,i)?"positive":r._isBanned(t)&&e!=="warning"?"negative":e==="caution"?"caution":"warning"}static _getTaxType(t){return t===null?"unknown":typeof t!="number"?r._isDextoolsBuySellTax(t)?Number(t.max)*100=xh?"negative":"warning":"unknown":t*100=xh?"negative":"warning"}static _isDextoolsBuySellTax(t){return typeof t!="string"&&t.status!=="unknown"}static _getTypeByOwnership(t,e,i=!1){return r._getType(t,e,i)}static _getAuditProviderUrl(t,e,i){try{let n=Wo[e];return t==="quickintel"?`${hr[t]}?type=token&chain=${n?.[t]}&contractAddress=${i.token}`:t==="honeypotis"?`${hr[t]}/${n?.[t]}?address=${i.token}`:`${hr[t]}/${n?.[t]}/${i.token}`}catch(n){console.error(`Chain "${i.chain}" is not supported in audits. Check supported chains.`,n)}return hr[t]??""}static _getAuditProviderLogo(t){return t==="tokensniffer"?`assets/img/audits/${t}.svg`:`assets/img/audits/${t}.png`}static _getAuditAlerts(t){let e={};for(let i of Object.values(t).filter(n=>["negative","warning"].includes(n.color)))e[i.name]={value:`${i.value}`,type:i.color.includes("negative")?"negative":"warning"};return e}static _getTotalAlerts(t){let e=[];for(let i of Object.values(t))e.push(i.alerts);return Object.assign({},...e)}};var Dh="lastExchangesCheck",Rg=30*Wt,V=class V{static{this._exchangesChanged$=new B}static{this.exchangesChanged$=V._exchangesChanged$.asObservable().pipe(zi(500))}static{this._exchangesAdded$=new B}static{this.exchangesAdded$=V._exchangesAdded$.asObservable()}static{this._chainStatsUpdated$=new B}static{this.chainStatsUpdated$=V._chainStatsUpdated$.asObservable()}static{this._chainStats={}}static{this._chainExchangesList={}}static{this._fullExchangeList=[]}static get chainExchangeList(){return this._chainExchangesList}static set chainExchangeList(t){this._chainExchangesList=t,this.chainStats=V._getChainStats(t),this.fullExchangeList=V._getFullExchangeList(t),this._exchangesChanged$.next()}static get fullExchangeList(){return this._fullExchangeList}static set fullExchangeList(t){this._fullExchangeList=t}static set chainStats(t){V._chainStats=t,V._chainStatsUpdated$.next(Object.keys(t))}static get chainStats(){return V._chainStats}static getGenericExchangeApi(t){return t??Mn}static getExchangeNameFromExchangeApi(t=Mn,e){return(V.chainExchangeList[e]??[]).find(i=>i.slug===t)?.name??Qi}static getDefaultPairByExchange(t,e){return(V.chainExchangeList[e]??[]).find(i=>i.name.toLowerCase()===t.toLowerCase())?.pairDefault??""}static getExchangeByFactory(t,e){let i=t.toLowerCase();return e==="tron"&&(i=t),(V.chainExchangeList[e]??[]).find(n=>n.factory?.toLowerCase()===i)?.slug}static getExchangeVersion(t,e){return(V.chainExchangeList[e]??[]).find(i=>i.slug===t)?.version??""}static getChainByExchangeApi(t){return en.find(e=>(V.chainExchangeList[e]??[]).some(i=>i.slug===t)?e:!1)??"ether"}static getExchangeSwapUrl(t,e,i="",n=null,s="sell",a){let o=i==="v1"?"":i.toLowerCase(),l=(V.chainExchangeList[t]??[]).find(u=>u.name.toLowerCase()===e.toLowerCase()&&(!u.version||u.version&&u.version===o))?.urlSwap??"#";if(n==null||l==="#")return l;let c;try{c=new URL(l).search.length>0}catch{console.warn(`Could not parse swap url for ${e}. Please verify url: ${l}`),c=!1}let d=c?"&":"?";return bc.test(e)&&t==="ton"?`${l}${n}`:(yc.test(e)||Sc.test(e))&&t==="tron"?`${l}${n}`:Ic.test(e)&&t==="solana"?`${l}${n}`:wc.test(e)&&t==="icp"?`${l}${d}payToken=${a}&receiveToken=${n}`:Ec.test(e)&&t==="icp"?`${l}${d}tokenin=${a}&tokenout=${n}`:Tc.test(e)&&t==="bnb"?`${l}${n}`:s==="buy"?e.toLowerCase()===Ia.toLowerCase()&&t==="aptos"?`${l}${d}to=${n}`:e.toLowerCase()===Ta&&t==="ton"?`${l}${d}ft=${n}`:e.toLowerCase()===wa&&t==="near"?`${l}/#${n}`:`${l}${d}outputCurrency=${n}`:s==="sell"?e.toLowerCase()===Ia.toLowerCase()&&t==="aptos"?`${l}${d}from=${n}`:e.toLowerCase()===Ta&&t==="ton"?`${l}${d}tt=${n}`:e.toLowerCase()===wa&&t==="near"?`${l}/#${n}`:`${l}${d}inputCurrency=${n}`:l}static getExchangeInfoUrl(t,e){return(V.chainExchangeList[e]??[]).find(i=>i.slug===t)?.urlInfo??"#"}static getDefaultExchange(t){return(V.chainExchangeList[t??"ether"]??[]).find(e=>e.isDefault)?.name??fc}static getExchangeLogoUrl(t,e){let i=(V.chainExchangeList[e]??[]).find(n=>n.name.toLowerCase()===t.toLowerCase()||n.slug===t?n:!1);return i?`${Ji}${i.logo}`:`${_c}`}static valueIsExchangeApi(t,e){return(V.chainExchangeList[e]??[]).some(i=>i.slug===t)}static valueIsExchange(t,e){return(V.chainExchangeList[e]??[]).some(i=>i.name===t)}static getExchangeNameWithoutVersion(t){return t.replace(/\s(.*)(v\d+)$/,"")}static isExchangeSpecificVersion(t,e="ether"){return(V.chainExchangeList[e]??[]).find(i=>i.slug===t&&!!i.version)?.version??null}static getExchangeBackgroundColor(t,e="ether"){return(V.chainExchangeList[e]??[]).find(i=>i.name.toLowerCase()===t.toLowerCase()||i.slug===t)?.backgroundColor??vc}static getExchangeTextColor(t,e="ether"){return(V.chainExchangeList[e]??[]).find(i=>i.name.toLowerCase()===t.toLowerCase()||i.slug===t)?.textColor??Cc}static getExchangeApiFromExchange(t,e="ether"){return(V.chainExchangeList[e]??[]).find(i=>t.toLowerCase()===i.name.toLowerCase())?.slug??gc}static hasExchangePoolRatios(t,e="ether"){return(V.chainExchangeList[e]??[]).find(i=>t===i.slug)?.hasPoolRatios??!1}static getExchangeLimitBotSupported(t,e="ether"){return(V.chainExchangeList[e]??[]).find(i=>i.name.toLowerCase()===t.toLowerCase())?.limitBotSupported??!1}static isExchangeInChain(t,e="ether"){return(V.chainExchangeList[e]??[]).some(i=>i.slug===t)}static getExchangesFromChain(t="ether"){return V.chainExchangeList[t??"ether"]?.filter(e=>e.name!==Qi)??[]}static getLogoStyle(t,e="ether"){let i=t.toLowerCase(),n=(V.chainExchangeList[e]??[]).find(s=>s.slug===t||s.name.toLowerCase()===i)?.logoStyles;return n?n.replace(/[{}]/g,""):""}static get isExchangeListExpired(){let t=ne.getDate(Dh);return t?Date.now()-Rg>t.getTime():!0}static updateExchangesCheckDate(){ne.setDate(Dh)}static _getChainStats(t){let e={};for(let i of y.allChains){let n=i.chain;for(let s of t[n]??[]){e[n]||(e[n]={exchanges:[]});let a=s.version?V.getExchangeNameWithoutVersion(s.name):s.name,o={name:a,logo:`${Ji}${s.logo}`,exchange:s.slug};if(e[n].exchanges.length===0||!s.version&&e[n].exchanges.length>0)e[n].exchanges.push(o);else{let l=e[n].exchanges.findIndex(c=>c.name?.toLowerCase()===a.toLowerCase());l===-1?e[n].exchanges.push(o):s.isDefault&&(e[n].exchanges[l].exchange=s.slug)}}}return e}static _getFullExchangeList(t){let e=[];for(let i of Object.keys(t))e=[...e,...t[i]??[]];return e}static isCurveAddress(t){return/^(0x)[\dA-Fa-f]{40}(?:-\d{1,2}){2}u?$/.test(t)}static isBalancerAddress(t){return/^(?:0x[\dA-Fa-f]{40}-){2}0x[\dA-Fa-f]{40}$/.test(t)}static getAlikeExchange(t,e){return(V.chainExchangeList[e]??[]).find(i=>t===i.slug)?.alike??null}static getExchangeBySlug(t,e){return(V.chainExchangeList[e]??[]).find(i=>i.slug===t)}static sortExchangesBySlugs(t,e){let i=new Map(t.map(a=>[a.slug,a])),n=[],s=new Set;for(let a of e.data){let o=i.get(a.slug);o&&(n.push(o),s.add(a.slug))}for(let a of t)s.has(a.slug)||n.push(a);return n}};Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"getExchangeByFactory",1),Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"getExchangeVersion",1),Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"getExchangeInfoUrl",1),Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"getExchangeBackgroundColor",1),Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"getExchangeTextColor",1),Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"getExchangeApiFromExchange",1),Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"hasExchangePoolRatios",1),Ze([Je({clearSignal:V.exchangesChanged$})],V,"getExchangesFromChain",1),Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"getLogoStyle",1),Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"getAlikeExchange",1),Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`,clearSignal:V.exchangesChanged$})],V,"getExchangeBySlug",1);var Ve=V;var Mt="assets/img/lockers/",xg="https://beta.uncx.network/lockers/explore/pools",wn=class r{static getLocksProviderUrl(t,e,i=!1){switch(t.providerId==null?t:t.providerId){case Rs:case As:return e.id?`https://team.finance/view-coin/${e.id}?name=${e.name}&symbol=${e.symbol}&chainid=${Yo[e.chain]}`:"https://team.finance";case qo:return"https://fairtokenproject.com/#locks";case xs:return r._getDxSaleURL(e?.lockerContract,e.chain,i);case Ls:return`https://mudra.website/?certificate=yes&type=0&lp=${e.pair}`;case ks:return t?.type==="pair"||!i?`https://locker.flokifi.com/view/1/${e.pair}/${Fs[e.chain]}`:`https://locker.flokifi.com/view/0/${e.id}/${Fs[e.chain]}`;case Ps:return`https://gempad.app/locks?tab=${e.tabUrlParam??0}&q=${e.id}`;case Os:return e.urlParam?`https://app.apexpad.finance/sol/locker/locker-details/${e.urlParam}?cluster=mainnet-beta`:"https://app.apexpad.finance/sol/locker";case Ds:return e.urlParam?e.chain==="solana"?`https://www.pinksale.finance/solana/pinklock/record/${e.urlParam}`:`https://www.pinksale.finance/pinklock/${Xo[e.chain]}/${e.urlParam}`:"https://www.pinksale.finance/pinklock/liquidity?chainName=";case Ms:return`https://app.ref.finance/pool/${e.pair}`;case Ns:return`https://app.unvest.io/projects/${Qo[e.chain]}/${e.id}`;default:return e.chain==="solana"?e.lockUrl?`https://solana.uncx.network/lockers/cpmm/${e.pair}`:"https://solana.uncx.network/lockers/explore/pools":t?.lockUrl?t?.lockUrl??null:xg}}static getLocksProviderLogo(t){switch(t){case Rs:case As:return`${Mt}team.png`;case qo:return`${Mt}fair-token-project.png`;case xs:return`${Mt}dx.png`;case Ds:return`${Mt}pinksale.png`;case Os:return`${Mt}soltools.webp`;case Ls:return`${Mt}mudra.png`;case ks:return`${Mt}floki.png`;case Ps:return`${Mt}gem-pad.png`;case Ms:return`${Mt}ref-finance.png`;case Ns:return`${Mt}unvest.webp`;default:return`${Mt}uncx.svg`}}static isLocksProviderSupportedInChain(t,e){switch(t){case Ch:return!!bh[e];case Ds:return!!Xo[e];case Os:return!!vh[e];case xs:return!!Zo[e];case Rs:case As:return!!Yo[e];case Ls:return e==="bnb";case ks:return!!Fs[e];case Ps:return!!yh[e];case Ms:return!!Sh[e];case Ns:return!!Qo[e];default:return!1}}static _getDxSaleURL(t,e,i){return t?`https://dx.app/dxlock/view/${i?"token-locker":"liquidity-locker"}?address=${t}&chain=${Zo[e]}`:"https://dx.app/"}static processesLocks(t){return t.length===0?[]:this._removeDuplicateLocks(t).filter(e=>this._checkValidLock(e))}static formatLocks(t){return this._isLocksV2(t)?this._convertToLocksArray(t):[...t]}static _isLocksV2(t){return!Array.isArray(t)}static _convertToLocksArray(t){return Object.values(t).flatMap(e=>Object.values(e.locks??{}))}static _removeDuplicateLocks(t){let e=[];return t.map(i=>e.some(n=>n.lockId===i.lockId&&n.unlockDate===i.unlockDate&&n.amount===i.amount)?null:e.push(i)),e}static _checkValidLock(t){return new Date(t.unlockDate).getTime()-Date.now()>0&&!Number.isNaN(t.amount)}};var Us=class{static isTurboTicker(t){return(t&&t.total>=1e3)??!1}};var yt=class r{static filterPairsWithValidSymbol(t,e){return e.filter(i=>y.isChainSymbol(t,i.symbol)||y.isStableSymbol(t,i.symbol)||y.isChainSymbol(t,i.symbolRef)||y.isStableSymbol(t,i.symbolRef)?i:!1)}static isStableNativePair(t){return t==="stable-native-pair"}static normalizeLogoUrl(t){return t?t.includes("https://")||t.includes("http://")||t.startsWith("data:")?t:Eh+t:""}static normalizeAptosTokenId(t){return t.split(":",1).shift()??""}static normalizeAptosPairAddress(t){return t.split("<",1).shift()??""}static getPriceVariation(t,e){return t&&e?(t/e-1)*100:0}static getPublicAddress(t,e){return y.isEVMChain(e)?(t=t.toLowerCase(),/^0x[a-fA-F0-9]{64}$/.test(t)?t.slice(0,Or):t.slice(0,tn)):t}static checkIsCurveAddress(t,e){return y.isEVMChain(e)&&Ve.isCurveAddress(t)&&!Ae.REGEX_SAFE_STRING.test(t)}static checkIsBalancerAddress(t,e){return y.isEVMChain(e)&&Ve.isBalancerAddress(t)&&!Ae.REGEX_SAFE_STRING.test(t)}static checkIsEVMAddress(t,e){return y.isEVMChain(e)&&!this.checkIsCurveAddress(t,e)&&!this.checkIsBalancerAddress(t,e)}static getEVMPairAddressAndFragmentByURL(t,e){let i=t.slice(0,xa).toLowerCase();return this.checkIsCurveAddress(i,e)?{pair:i,fragment:t.slice(xa+1)||null}:(i=t.slice(0,Da).toLowerCase(),this.checkIsBalancerAddress(i,e)?{pair:i,fragment:t.slice(Da+1)||null}:(i=t.toLowerCase(),/^0x[a-fA-F0-9]{64}$/.test(i)&&!Ae.REGEX_SAFE_STRING.test(i)?{pair:i.slice(0,Or),fragment:i.slice(Or+1)||null}:{pair:t.slice(0,tn),fragment:t.slice(tn+1)||null}))}static getPairUrlFromChainScanner(t,e){let i=y.getScannerDataByChain(t);switch(t){case"solana":case"aptos":{let n=r.normalizeAptosPairAddress(e);return`${i.url}/account/${n}`}case"kujira":return`${i.url}/contract/${e}`;case"ton":return`${i.url}/${e}`;case"hedera":return`${i.url}/mainnet/contract/${e}`;case"tron":return`${i.url}/#/contract/${e}`;case"icp":return`${i.url}/canister/${e}`;case"sui":return`${i.url}/object/${e}`;default:return`${i.url}/address/${e}`}}static formatPair(t){let e=Ve.getExchangeBySlug(t.id.exchange,t.id.chain),i=r.isStableNativePair(t.type),n=i?t.symbolRef:t.symbol,s=i?t.symbol:t.symbolRef,a=[];t.locks&&(a=wn.formatLocks(t.locks));let o=t.ratio0&&t.ratio1?`${t.ratio0}% ${n} - ${t.ratio1}% ${s}`:void 0,l=t.ampBps?t.ampBps/1e4:void 0;return{address:t.id.pair,chain:t.id.chain,created:new Date(t.creationTime).getTime(),exchange:{slug:e?.slug??"",name:e?.name??"",version:e?.version??"",hasExchangePoolRatios:e?.hasPoolRatios??!1},isStableNative:i,name:i?t.nameRef:t.name,symbol:n,symbolRef:s,pool:t.pool,pairType:t.type,locks:a,whitelisted:t.votes?._warning===-1,fee:t.fee,amp:l,ratio:o,team:t.team,isTurboTicker:Us.isTurboTicker(t.nitro),nitro:t.nitro,startBondingCurve:t.startBondingCurve}}static calculatePairPrices(t){let e=r.isStableNativePair(t.type),i=e?t.metrics.reserveRef:t.metrics.reserve,s=(e?t.metrics.reserve:t.metrics.reserveRef)/i;return{priceUsd:t.price,priceETH:s,poolPriceUsd:t.poolPrice}}static getPairPriceVariations(t){return{price5m:t.price5m?.price,price1h:t.price1h?.price,price6h:t.price6h?.price,price24h:t.price24h?.price,price7d:t.price7d?.price}}static formatPairVotes(t){let e=t.downvotes+t.upvotes;return{downvotes:{total:t.downvotes,percent:t.downvotes*100/e},total:e,upvotes:{total:t.upvotes,percent:t.upvotes*100/e}}}static getBurnedLiquidityPercentage(t,e){return e&&t&&e>=t?t*100/e:0}static proccessLiquidityData(t){return t.makers.map((e,i)=>j(f({},e),{id:i+1,percent:t.total.balanceLpToken?e.balanceLpToken/t.total.balanceLpToken*100:0,balanceLpTokenRemoved:Math.abs(e.balanceLpTokenRemoved),balanceLpTokenBurned:Math.abs(e.balanceLpTokenBurned)}))}static _mapPeriodStats(t){return{first:t?.price?.usd.first??0,volume:t?.volume?.total??0,priceVariationUsd:t?.price?.usd.diff??0,minPriceUsd:t?.price?.usd.min??0,maxPriceUsd:t?.price?.usd.max??0,makers:t?.makers??0,volumeSells:t?.volume?.sells??0,volumeBuys:t?.volume?.buys??0,totalTransactions:t?.swaps?.total??0,volatility:t?.volatility??0,buys:t?.swaps?.buys??0,sells:t?.swaps?.sells??0}}static formatPeriodStats(t){return{period5m:this._mapPeriodStats(t.periodStats["5m"]),period1h:this._mapPeriodStats(t.periodStats["1h"]),period6h:this._mapPeriodStats(t.periodStats["6h"]),period24h:this._mapPeriodStats(t.periodStats["24h"]),period7d:this._mapPeriodStats7d(t)}}static _mapPeriodStats7d(t){let e=t.price,i=t.price7d;return{volume:i?.volume??0,priceVariationUsd:i?.price?ft.calculateVariationPrice(i.price,e):0,minPriceUsd:i?.minPrice??0,maxPriceUsd:i?.maxPrice??0,makers:i?.makers??0,volumeSells:i?.sellsVolume??0,volumeBuys:i?.buysVolume??0,totalTransactions:i?.swaps??0,volatility:0,buys:i?.buys??0,sells:i?.sells??0}}static getDynamicLengthAddress(t,e,i){let n=y.isValidTokenAddressForChain(i,t);if(i==="sui"&&n){let s=t.match(Rc);return s?s[0].length:0}else return e}};var $i=class r{static addToMetamask(t,e,i,n){if(!t){console.error("Add to metamask: cannot add to Metamask a token without address");return}if(!window.ethereum){console.error("Add to metamask: Metamask is not installed");return}window.ethereum.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:t,symbol:e??"unknown",decimals:i,image:n?yt.normalizeLogoUrl(n):""}}})}static getFirstValidCharacter(t,e){let i=t.trim().length>0?[...t.trim()][0]?.trim():"?";if(Ae.hasEmojis(i)||i==="?"){if(e){let n=Ae.removeEmojis(e).trim();if(n.length>0)return n[0]}return"?"}return i}static getPriceVariation(t,e){if(t&&e){let i=t>e?(t-e)/e*100:(e-t)/e*100;return t>=e?Math.abs(i):-Math.abs(i)}return 0}static getOklinkUrl(t,e){let i=y.getOklinkUrl(t);return i?`${i}/${e}`:null}static getTokenUrlFromChainScanner(t,e){let i=y.getScannerDataByChain(t);switch(t){case"telos":case"ultron":case"zksync":case"qubic":return`${i.url}/address/${e}`;case"pawchain":case"multiversx":return`${i.url}/tokens/${e}`;case"aptos":{let n=yt.normalizeAptosTokenId(e);return`${i.url}/account/${n}`}case"kujira":return`${i.url}/token/${y.encodeURIId(t,e)}`;case"osmosis":return`${i.url}/assets/${this._getOsmosisTokenScannerPath(e)}`;case"ton":return`${i.url}/${e}`;case"hedera":return`${i.url}/mainnet/token/${e}`;case"tron":return`${i.url}/#/contract/${e}`;case"sui":return`${i.url}/coin/${e}`;default:return`${i.url}/token/${e}`}}static _getOsmosisTokenScannerPath(t){let e=/(ibc\/[\dA-Z]{64})/,i=/(factory\/osmo[\da-z]{36,62}\/[A-Za-z]{1,100})/;return e.test(t)?`ibc/${window.btoa(t)}`:i.test(t)?`native/${window.btoa(t)}`:`staking/${window.btoa(t)}`}static isFromTokenCreator(t){return t?t.provider==="dextools":!1}static formatTokenItemsWithAllData(t){return t.map(e=>({id:e.id.token,chain:e.chain,name:e.name,logo:e.logo,symbol:e.symbol,price:e.price,dextScore:e.reprPair?.dextScore?.first[0]?.total??0,volume24h:e.volume24h,totalMarketCap:e.metrics.fdv,swaps24h:e.swaps24h,creationTime:e.creationTime}))}static getHoldersChartUrl(t,e){let i=y.getHoldersChartUrlByChain(t);return t==="solana"?`${i}${e}#analysis`:i?`${i}${e}`:void 0}static formatToken(t,e){let i=t.token,n=[],s,a;i.locks&&(n=wn.formatLocks(i.locks)),i.audit&&(s=i.audit),t.openTime&&(a=t.openTime);let o=e?t.id.token:t.id.tokenRef;return{symbol:i.symbol,address:i.id.token,logo:i.logo?yt.normalizeLogoUrl(i.logo):"",audio:i.audio?yt.normalizeLogoUrl(i.audio):"",banner:i.banner,decimals:+i.decimals,isFromTokenCreator:r.isFromTokenCreator(i.deployment),isVentures:!!i.info?.ventures,description:i.info?.description,created:new Date(i.creationTime).getTime(),stories:i.stories,locks:n,audit:s,categories:i.categories,disclaimers:t.disclaimers??{},openTime:a,socialLinks:this._getSocialLinks(i),tokenVs:o}}static _getSocialLinks(t){return j(f({},t.links),{cmc:t.info?.cmc??"",coingecko:t.info?.coingecko??"",email:t.info?.email??"",extraInfo:t.info?.extraInfo??""})}static getLiquidityToken(t){let e=t?t.pairs:[];if(e!==void 0&&e.length>0)return e[0].metrics.liquidity}static getTokenPoolInfo(t,e){let i=t.token.metrics??{},n=i.circulatingSupply?+i.circulatingSupply:0,s=i.totalSupply?+i.totalSupply:0,a=i.mcap??e.marketCap,o=i.fdv==null?e.totalMarketCap:`${i.fdv}`,l=t.price24h?.volume;return{circulatingSupply:n||s,totalSupply:s,maxSupply:i.maxSupply?`${i.maxSupply}`:void 0,marketCap:a?`${a}`:o,totalMarketCap:o||void 0,vol24h:l,liquidity:t.metrics.liquidity}}static getBubblemapsUrl(t,e){return`https://app.bubblemaps.io/${Ih[t]}/token/${e}`}};var Lg=95,kg=2*Fe,Pg=30,pr=new Set(["buy","sell"]),Og=new Set(["add","remove"]),St={xsmall:1,small:1e3,medium:3e3,big:1e4},Mg=/^0x[\dA-Fa-f]{64}$/,oy={xsmall:{max:St.xsmall},small:{min:St.xsmall,max:St.small},medium:{min:St.small,max:St.medium},big:{min:St.medium,max:St.big},huge:{min:St.big}},mr={small:{minSupplyPercentage:0,maxSupplyPercentage:.005},medium:{minSupplyPercentage:.005,maxSupplyPercentage:.01},big:{minSupplyPercentage:.01,maxSupplyPercentage:.05},huge:{minSupplyPercentage:.05,maxSupplyPercentage:Number.MAX_SAFE_INTEGER}},el=5,Ui=class r{static isFrontRunning(t,e){let i=!!(t?.others?.botAddress&&e?.others?.botAddress&&t.others.botAddress===e.others.botAddress),n=t.maker===e.maker,s=pr.has(t.type)&&pr.has(e.type),a=t.type!==e.type,o=t.id!==e.id,l=t.timestamp===e.timestamp,c=t.amountToken===e.amountToken,d=Math.abs(t.timestamp-e.timestamp)!e.some((n,s)=>{let a=r.isTransactionDuplicated(i,n);return a&&(e[s]=f(f({},e[s]),i)),a}))}static isTransactionDuplicated(t,e){return t.id===e.id&&t.logIndex===e.logIndex&&t.blockNumber===e.blockNumber}static filterBuysSellsOnly(t){return t.filter(e=>pr.has(e.type))}static filterRelevantTransactions(t,e=!1){return e?[...t]:r.filterBuysSellsOnly(t)}static analyzeTransactions(t,e){let i=this._getMinMaxSwapsByChain(e);if(t.length<=i.minSwaps||t.length>=i.maxSwaps)return null;let n=[...t].sort((d,u)=>d.timestamp-u.timestamp);if((n[n.length-1].timestamp-n[0].timestamp)*1e3>kg)return null;let a=new Map,o=0,l=0;for(let d of t){if(d.type==="sell"&&this._isValidSell(l,t,d)){let u=a.get(d.maker);u?u.push(d.id):a.set(d.maker,[d.id])}pr.has(d.type)&&o++,l++}let c=this._calculatePercent(t.length,o,a);return{percentSuccess:Lg,analysisResultPercent:c,isOnlyBuySwaps:c===100}}static getIndexedBlock({logIndex:t,blockNumber:e}){return Number.parseFloat(`${e}.${t?.toString().padStart(3,"0")??"000"}`)}static getSwapSize(t){let e=t.amountUSD;if(!(t.type==="add"||t.type==="remove"||t.type==="init"))return e<=St.xsmall?"xsmall":e<=St.small?"small":e<=St.medium?"medium":e<=St.big?"big":"huge"}static getBuysSellsProgressPercentage(t){return t.sellsVolume&&t.buysVolume?100*(t.buysVolume??0)/((t.buysVolume??0)+(t.sellsVolume??0)):!t.sellsVolume&&t.buysVolume?100:0}static getTransactionUrlFromChainScanner(t,e){let i=y.getScannerDataByChain(t);switch(t){case"aptos":return`${i.url}/txn/${e}`;case"xrpl":case"multiversx":return`${i.url}/transactions/${e}`;case"ton":return`${i.url}/transaction/${e}`;case"near":return`${i.url}/txns/${e}`;case"hedera":return`${i.url}/mainnet/transaction/${e}`;case"tron":{let n=r.normalizeTronTransactionAddress(e);return`${i.url}/#/transaction/${n}`}default:return`${i.url}/tx/${e}`}}static _calculatePercent(t,e,i){let n=[...i.values()].sort((a,o)=>o.length-a.length).slice(0,2).flat(),s=t-e-n.length;return e*100/(s+e)}static _isValidSell(t,e,i){let n=e[t-1]?.priceUSD??null,s=e[t-2]?.priceUSD??null;return t>2&&i?.priceUSD?e[t-1].type==="sell"||!!n&&n>i.priceUSD&&e[t-1].type==="sell"||!!s&&s>i.priceUSD:!0}static _getMinMaxSwapsByChain(t){return t==="ether"?{minSwaps:100,maxSwaps:400}:{minSwaps:200,maxSwaps:500}}static isHashValid(t){return Mg.test(t)}static formatTransactions(t,e){return t.map(i=>{let n=Og.has(i.type),s=e?i.amountRef:i.amountToken,a=e?i.amountToken:i.amountRef?i.amountRef:0,o=i.amountUSD??(s??0)*i.price,l=j(f({},i),{indexedBlock:r.getIndexedBlock(i),type:n?i.type:this.getType(i.type,e),amountToken:s??0,amountETH:i.amountETH,amountUSD:n?i.eventLiquidity:o,amountRef:a,poolLiquidityChange:n,priceUSD:i.price,size:void 0});return l.size=r.getSwapSize(l),l})}static getType(t,e){return e&&(t==="sell"||t==="buy")?t==="sell"?"buy":"sell":t}static normalizeTronTransactionAddress(t){return t.replace(xc,"$2")}static getMakerBalanceSize(t,e){return t<=e*mr.small.maxSupplyPercentage?"small":t>e*mr.medium.minSupplyPercentage&&t<=e*mr.medium.maxSupplyPercentage?"medium":t>e*mr.big.minSupplyPercentage&&t<=e*mr.big.maxSupplyPercentage?"big":"huge"}static isBuyOrSellTransaction(t){return pr.has(t)}static manageTransactions(t){let{newTransactions:e,existingTransactions:i,isRT:n,isStableNativePair:s,liquidityTransactionsSupported:a=!1,sorting:o="desc"}=t,l=r.removeDuplicateTransactions(e,i),c=n?r.filterRelevantTransactions(l,a):l,u=r.formatTransactions(c,s).sort((p,m)=>p.timestamp===m.timestamp?m.indexedBlock-p.indexedBlock:m.timestamp-p.timestamp),h=this.fillTransactionsWithFrontRunning(u,i);return o==="desc"?h:h.reverse()}static fillTransactionsWithFrontRunning(t,e){let i=[];for(let n of t){let s,a=ve.binarySearch(e,n.timestamp,"timestamp");[...e.slice(a>=el?a-el:a,a+el),...i].some(c=>{if(r.isFrontRunning(c,n)){let d=Math.abs(n.amountETH-c.amountETH);return c.frontRunning=d,s=d,!0}return!1});let l=j(f({},n),{frontRunning:s});i.push(l)}return i}};var Bs=class r{constructor(){this._registryIcons=new Map}addIcons(t){for(let e of t)e.name!=""&&e.svgData!=""?this._registryIcons.set(e.name,{svgData:e.svgData,viewBox:e?.viewBox??void 0}):console.warn("Icon name or icon svgData cant be empty")}getIcon(t){return this._registryIcons.has(t)||console.warn(`Icon ${t} not found on custom library`),this._registryIcons.get(t)}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var tl=(()=>{class r extends fi{static \u0275fac=(()=>{let e;return function(n){return(e||(e=ze(r)))(n||r)}})();static \u0275cmp=Q({type:r,selectors:[["BarsIcon"]],standalone:!0,features:[Xt,ue],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M13.3226 3.6129H0.677419C0.497757 3.6129 0.325452 3.54152 0.198411 3.41448C0.0713707 3.28744 0 3.11514 0 2.93548C0 2.75581 0.0713707 2.58351 0.198411 2.45647C0.325452 2.32943 0.497757 2.25806 0.677419 2.25806H13.3226C13.5022 2.25806 13.6745 2.32943 13.8016 2.45647C13.9286 2.58351 14 2.75581 14 2.93548C14 3.11514 13.9286 3.28744 13.8016 3.41448C13.6745 3.54152 13.5022 3.6129 13.3226 3.6129ZM13.3226 7.67741H0.677419C0.497757 7.67741 0.325452 7.60604 0.198411 7.479C0.0713707 7.35196 0 7.17965 0 6.99999C0 6.82033 0.0713707 6.64802 0.198411 6.52098C0.325452 6.39394 0.497757 6.32257 0.677419 6.32257H13.3226C13.5022 6.32257 13.6745 6.39394 13.8016 6.52098C13.9286 6.64802 14 6.82033 14 6.99999C14 7.17965 13.9286 7.35196 13.8016 7.479C13.6745 7.60604 13.5022 7.67741 13.3226 7.67741ZM0.677419 11.7419H13.3226C13.5022 11.7419 13.6745 11.6706 13.8016 11.5435C13.9286 11.4165 14 11.2442 14 11.0645C14 10.8848 13.9286 10.7125 13.8016 10.5855C13.6745 10.4585 13.5022 10.3871 13.3226 10.3871H0.677419C0.497757 10.3871 0.325452 10.4585 0.198411 10.5855C0.0713707 10.7125 0 10.8848 0 11.0645C0 11.2442 0.0713707 11.4165 0.198411 11.5435C0.325452 11.6706 0.497757 11.7419 0.677419 11.7419Z","fill","currentColor"]],template:function(i,n){i&1&&(oi(),F(0,"svg",0),X(1,"path",1),O()),i&2&&(We(n.getClassNames()),Z("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role))},encapsulation:2})}return r})();var Ng=["menubar"],Fg=(r,t)=>({"p-submenu-list":r,"p-menubar-root-list":t}),Lh=r=>({"p-menuitem-link":!0,"p-disabled":r}),Vg=()=>({exact:!1}),$g=(r,t)=>({$implicit:r,root:t});function Ug(r,t){if(r&1&&X(0,"li",8),r&2){let e=w().$implicit,i=w();v("ngStyle",i.getItemProp(e,"style"))("ngClass",i.getSeparatorItemClass(e)),Z("id",i.getItemId(e))("data-pc-section","separator")}}function Bg(r,t){if(r&1&&X(0,"span",19),r&2){let e=w(4).$implicit,i=w();v("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),Z("data-pc-section","icon")("tabindex",-1)}}function Hg(r,t){if(r&1&&(F(0,"span",20),Ee(1),O()),r&2){let e=w(4).$implicit,i=w();v("id",i.getItemLabelId(e)),Z("data-pc-section","label"),I(),jt(" ",i.getItemLabel(e)," ")}}function jg(r,t){if(r&1&&X(0,"span",21),r&2){let e=w(4).$implicit,i=w();v("innerHTML",i.getItemLabel(e),fa)("id",i.getItemLabelId(e)),Z("data-pc-section","label")}}function zg(r,t){if(r&1&&(F(0,"span",22),Ee(1),O()),r&2){let e=w(4).$implicit,i=w();v("ngClass",i.getItemProp(e,"badgeStyleClass")),I(),Ei(i.getItemProp(e,"badge"))}}function Wg(r,t){r&1&&X(0,"AngleDownIcon",25),r&2&&(v("styleClass","p-submenu-icon"),Z("data-pc-section","submenuicon"))}function Gg(r,t){r&1&&X(0,"AngleRightIcon",25),r&2&&(v("styleClass","p-submenu-icon"),Z("data-pc-section","submenuicon"))}function Kg(r,t){if(r&1&&(Et(0),$(1,Wg,1,2,"AngleDownIcon",24)(2,Gg,1,2,"AngleRightIcon",24),At()),r&2){let e=w(6);I(),v("ngIf",e.root),I(),v("ngIf",!e.root)}}function qg(r,t){}function Zg(r,t){r&1&&$(0,qg,0,0,"ng-template",26),r&2&&v("data-pc-section","submenuicon")}function Xg(r,t){if(r&1&&(Et(0),$(1,Kg,3,2,"ng-container",11)(2,Zg,1,1,null,23),At()),r&2){let e=w(5);I(),v("ngIf",!e.submenuIconTemplate),I(),v("ngTemplateOutlet",e.submenuIconTemplate)}}function Yg(r,t){if(r&1&&(F(0,"a",15),$(1,Bg,1,4,"span",16)(2,Hg,2,3,"span",17)(3,jg,1,3,"ng-template",null,2,Ar)(5,zg,2,2,"span",18)(6,Xg,3,2,"ng-container",11),O()),r&2){let e=Ht(4),i=w(3).$implicit,n=w();v("target",n.getItemProp(i,"target"))("ngClass",st(11,Lh,n.getItemProp(i,"disabled"))),Z("href",n.getItemProp(i,"url"),Ki)("data-automationid",n.getItemProp(i,"automationId"))("data-pc-section","action")("tabindex",-1),I(),v("ngIf",n.getItemProp(i,"icon")),I(),v("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),I(3),v("ngIf",n.getItemProp(i,"badge")),I(),v("ngIf",n.isItemGroup(i))}}function Qg(r,t){if(r&1&&X(0,"span",19),r&2){let e=w(4).$implicit,i=w();v("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),Z("data-pc-section","icon")("tabindex",-1)}}function Jg(r,t){if(r&1&&(F(0,"span",29),Ee(1),O()),r&2){let e=w(4).$implicit,i=w();I(),Ei(i.getItemLabel(e))}}function e1(r,t){if(r&1&&X(0,"span",30),r&2){let e=w(4).$implicit,i=w();v("innerHTML",i.getItemLabel(e),fa),Z("data-pc-section","label")}}function t1(r,t){if(r&1&&(F(0,"span",22),Ee(1),O()),r&2){let e=w(4).$implicit,i=w();v("ngClass",i.getItemProp(e,"badgeStyleClass")),I(),Ei(i.getItemProp(e,"badge"))}}function i1(r,t){r&1&&X(0,"AngleDownIcon",25),r&2&&(v("styleClass","p-submenu-icon"),Z("data-pc-section","submenuicon"))}function n1(r,t){r&1&&X(0,"AngleRightIcon",25),r&2&&(v("styleClass","p-submenu-icon"),Z("data-pc-section","submenuicon"))}function r1(r,t){if(r&1&&(Et(0),$(1,i1,1,2,"AngleDownIcon",24)(2,n1,1,2,"AngleRightIcon",24),At()),r&2){let e=w(6);I(),v("ngIf",e.root),I(),v("ngIf",!e.root)}}function s1(r,t){}function a1(r,t){r&1&&$(0,s1,0,0,"ng-template",26),r&2&&v("data-pc-section","submenuicon")}function o1(r,t){if(r&1&&(Et(0),$(1,r1,3,2,"ng-container",11)(2,a1,1,1,null,23),At()),r&2){w(5);let e=Ht(1);I(),v("ngIf",!e.submenuIconTemplate),I(),v("ngTemplateOutlet",e.submenuIconTemplate)}}function l1(r,t){if(r&1&&(F(0,"a",27),$(1,Qg,1,4,"span",16)(2,Jg,2,1,"span",28)(3,e1,1,2,"ng-template",null,3,Ar)(5,t1,2,2,"span",18)(6,o1,3,2,"ng-container",11),O()),r&2){let e=Ht(4),i=w(3).$implicit,n=w();v("routerLink",n.getItemProp(i,"routerLink"))("queryParams",n.getItemProp(i,"queryParams"))("routerLinkActive","p-menuitem-link-active")("routerLinkActiveOptions",n.getItemProp(i,"routerLinkActiveOptions")||Wl(20,Vg))("target",n.getItemProp(i,"target"))("ngClass",st(21,Lh,n.getItemProp(i,"disabled")))("fragment",n.getItemProp(i,"fragment"))("queryParamsHandling",n.getItemProp(i,"queryParamsHandling"))("preserveFragment",n.getItemProp(i,"preserveFragment"))("skipLocationChange",n.getItemProp(i,"skipLocationChange"))("replaceUrl",n.getItemProp(i,"replaceUrl"))("state",n.getItemProp(i,"state")),Z("data-automationid",n.getItemProp(i,"automationId"))("tabindex",-1)("data-pc-section","action"),I(),v("ngIf",n.getItemProp(i,"icon")),I(),v("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),I(3),v("ngIf",n.getItemProp(i,"badge")),I(),v("ngIf",n.isItemGroup(i))}}function c1(r,t){if(r&1&&(Et(0),$(1,Yg,7,13,"a",13)(2,l1,7,23,"a",14),At()),r&2){let e=w(2).$implicit,i=w();I(),v("ngIf",!i.getItemProp(e,"routerLink")),I(),v("ngIf",i.getItemProp(e,"routerLink"))}}function d1(r,t){}function u1(r,t){r&1&&$(0,d1,0,0,"ng-template")}function h1(r,t){if(r&1&&(Et(0),$(1,u1,1,0,null,31),At()),r&2){let e=w(2).$implicit,i=w();I(),v("ngTemplateOutlet",i.itemTemplate)("ngTemplateOutletContext",_a(2,$g,e.item,i.root))}}function p1(r,t){if(r&1){let e=pt();F(0,"p-menubarSub",32),xe("itemClick",function(n){ce(e);let s=w(3);return de(s.itemClick.emit(n))})("itemMouseEnter",function(n){ce(e);let s=w(3);return de(s.onItemMouseEnter(n))}),O()}if(r&2){let e=w(2).$implicit,i=w();v("itemTemplate",i.itemTemplate)("items",e.items)("mobileActive",i.mobileActive)("autoDisplay",i.autoDisplay)("menuId",i.menuId)("activeItemPath",i.activeItemPath)("focusedItemId",i.focusedItemId)("level",i.level+1)("ariaLabelledBy",i.getItemLabelId(e))}}function m1(r,t){if(r&1){let e=pt();F(0,"li",9,1)(2,"div",10),xe("click",function(n){ce(e);let s=w().$implicit,a=w();return de(a.onItemClick(n,s))})("mouseenter",function(n){ce(e);let s=w().$implicit,a=w();return de(a.onItemMouseEnter({$event:n,processedItem:s}))}),$(3,c1,3,2,"ng-container",11)(4,h1,2,5,"ng-container",11),O(),$(5,p1,1,9,"p-menubarSub",12),O()}if(r&2){let e=w(),i=e.$implicit,n=e.index,s=w();We(s.getItemProp(i,"styleClass")),v("ngStyle",s.getItemProp(i,"style"))("ngClass",s.getItemClass(i))("tooltipOptions",s.getItemProp(i,"tooltipOptions")),Z("id",s.getItemId(i))("data-pc-section","menuitem")("data-p-highlight",s.isItemActive(i))("data-p-focused",s.isItemFocused(i))("data-p-disabled",s.isItemDisabled(i))("aria-label",s.getItemLabel(i))("aria-disabled",s.isItemDisabled(i)||void 0)("aria-haspopup",s.isItemGroup(i)&&!s.getItemProp(i,"to")?"menu":void 0)("aria-expanded",s.isItemGroup(i)?s.isItemActive(i):void 0)("aria-level",s.level+1)("aria-setsize",s.getAriaSetSize())("aria-posinset",s.getAriaPosInset(n)),I(2),Z("data-pc-section","content"),I(),v("ngIf",!s.itemTemplate),I(),v("ngIf",s.itemTemplate),I(),v("ngIf",s.isItemVisible(i)&&s.isItemGroup(i))}}function f1(r,t){if(r&1&&$(0,Ug,1,4,"li",6)(1,m1,6,21,"li",7),r&2){let e=t.$implicit,i=w();v("ngIf",i.isItemVisible(e)&&i.getItemProp(e,"separator")),I(),v("ngIf",i.isItemVisible(e)&&!i.getItemProp(e,"separator"))}}var g1=["menubutton"],_1=["rootmenu"],C1=["*"],v1=r=>({"p-menubar p-component":!0,"p-menubar-mobile-active":r});function b1(r,t){r&1&&Ye(0)}function y1(r,t){if(r&1&&(F(0,"div",8),$(1,b1,1,0,"ng-container",9),O()),r&2){let e=w();I(),v("ngTemplateOutlet",e.startTemplate)}}function S1(r,t){r&1&&X(0,"BarsIcon")}function I1(r,t){}function T1(r,t){r&1&&$(0,I1,0,0,"ng-template")}function w1(r,t){if(r&1){let e=pt();F(0,"a",10,2),xe("click",function(n){ce(e);let s=w();return de(s.menuButtonClick(n))})("keydown",function(n){ce(e);let s=w();return de(s.menuButtonKeydown(n))}),$(2,S1,1,0,"BarsIcon",11)(3,T1,1,0,null,9),O()}if(r&2){let e=w();Z("aria-haspopup",!!(e.model.length&&e.model.length>0))("aria-expanded",e.mobileActive)("aria-controls",e.id)("aria-label",e.config.translation.aria.navigation)("data-pc-section","button"),I(2),v("ngIf",!e.menuIconTemplate),I(),v("ngTemplateOutlet",e.menuIconTemplate)}}function E1(r,t){r&1&&Ye(0)}function A1(r,t){if(r&1&&(F(0,"div",12),$(1,E1,1,0,"ng-container",9),O()),r&2){let e=w();I(),v("ngTemplateOutlet",e.endTemplate)}}function R1(r,t){r&1&&(F(0,"div",12),Qe(1),O())}var il=(()=>{class r{autoHide;autoHideDelay;mouseLeaves=new B;mouseLeft$=this.mouseLeaves.pipe(Cr(()=>Xe(this.autoHideDelay)),me(e=>this.autoHide&&e));static \u0275fac=function(i){return new(i||r)};static \u0275prov=E({token:r,factory:r.\u0275fac})}return r})(),x1=(()=>{class r{el;renderer;cd;menubarService;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;mobileActive;autoDisplay;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;submenuIconTemplate;itemClick=new W;itemMouseEnter=new W;menuFocus=new W;menuBlur=new W;menuKeydown=new W;menubarViewChild;mouseLeaveSubscriber;constructor(e,i,n,s){this.el=e,this.renderer=i,this.cd=n,this.menubarService=s}ngOnInit(){this.mouseLeaveSubscriber=this.menubarService.mouseLeft$.subscribe(()=>{this.cd.markForCheck()})}onItemClick(e,i){this.getItemProp(i,"command",{originalEvent:e,item:i.item}),this.itemClick.emit({originalEvent:e,processedItem:i,isFocus:!0})}getItemProp(e,i,n=null){return e&&e.item?be.getItemValue(e.item[i],n):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemLabelId(e){return`${this.menuId}_${e.key}_label`}getItemClass(e){return j(f({},this.getItemProp(e,"class")),{"p-menuitem":!0,"p-highlight":this.isItemActive(e),"p-menuitem-active":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)})}getItemLabel(e){return this.getItemProp(e,"label")}getSeparatorItemClass(e){return j(f({},this.getItemProp(e,"class")),{"p-menuitem-separator":!0})}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(i=>i.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return be.isNotEmpty(e.items)}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(i=>this.isItemVisible(i)&&this.getItemProp(i,"separator")).length+1}onItemMouseLeave(){this.menubarService.mouseLeaves.next(!0)}onItemMouseEnter(e){if(this.autoDisplay){this.menubarService.mouseLeaves.next(!1);let{event:i,processedItem:n}=e;this.itemMouseEnter.emit({originalEvent:i,processedItem:n})}}ngOnDestroy(){this.mouseLeaveSubscriber?.unsubscribe()}static \u0275fac=function(i){return new(i||r)(S(Ie),S(ht),S(Ne),S(il))};static \u0275cmp=Q({type:r,selectors:[["p-menubarSub"]],viewQuery:function(i,n){if(i&1&&Rt(Ng,7),i&2){let s;Te(s=we())&&(n.menubarViewChild=s.first)}},hostAttrs:[1,"p-element"],inputs:{items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",J],autoZIndex:[2,"autoZIndex","autoZIndex",J],baseZIndex:[2,"baseZIndex","baseZIndex",Ge],mobileActive:[2,"mobileActive","mobileActive",J],autoDisplay:[2,"autoDisplay","autoDisplay",J],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",Ge],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",submenuIconTemplate:"submenuIconTemplate"},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[Be],decls:3,vars:11,consts:[["menubar",""],["listItem",""],["htmlLabel",""],["htmlRouteLabel",""],["role","menubar",3,"focus","blur","keydown","ngClass","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"ngStyle","ngClass",4,"ngIf"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","class","tooltipOptions",4,"ngIf"],["role","separator",3,"ngStyle","ngClass"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","tooltipOptions"],[1,"p-menuitem-content",3,"click","mouseenter"],[4,"ngIf"],[3,"itemTemplate","items","mobileActive","autoDisplay","menuId","activeItemPath","focusedItemId","level","ariaLabelledBy","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","ngClass",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActive","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state",4,"ngIf"],["pRipple","",3,"target","ngClass"],["class","p-menuitem-icon",3,"ngClass","ngStyle",4,"ngIf"],["class","p-menuitem-text",3,"id",4,"ngIf","ngIfElse"],["class","p-menuitem-badge",3,"ngClass",4,"ngIf"],[1,"p-menuitem-icon",3,"ngClass","ngStyle"],[1,"p-menuitem-text",3,"id"],[1,"p-menuitem-text",3,"innerHTML","id"],[1,"p-menuitem-badge",3,"ngClass"],[4,"ngTemplateOutlet"],[3,"styleClass",4,"ngIf"],[3,"styleClass"],[3,"data-pc-section"],["pRipple","",3,"routerLink","queryParams","routerLinkActive","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state"],["class","p-menuitem-text",4,"ngIf","ngIfElse"],[1,"p-menuitem-text"],[1,"p-menuitem-text",3,"innerHTML"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"itemClick","itemMouseEnter","itemTemplate","items","mobileActive","autoDisplay","menuId","activeItemPath","focusedItemId","level","ariaLabelledBy"]],template:function(i,n){if(i&1){let s=pt();F(0,"ul",4,0),xe("focus",function(o){return ce(s),de(n.menuFocus.emit(o))})("blur",function(o){return ce(s),de(n.menuBlur.emit(o))})("keydown",function(o){return ce(s),de(n.menuKeydown.emit(o))}),$(2,f1,2,2,"ng-template",5),O()}i&2&&(v("ngClass",_a(8,Fg,!n.root,n.root))("tabindex",0),Z("data-pc-section","menu")("aria-label",n.ariaLabel)("aria-labelledBy",n.ariaLabelledBy)("id",n.root?n.menuId:null)("aria-activedescendant",n.focusedItemId),I(2),v("ngForOf",n.items))},dependencies:()=>[xt,ec,Ri,Yt,xi,Yr,Pd,ss,vu,wo,Io,r],encapsulation:2})}return r})(),kh=(()=>{class r{document;platformId;el;renderer;cd;config;menubarService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}style;styleClass;autoZIndex=!0;baseZIndex=0;autoDisplay=!0;autoHide;autoHideDelay=100;id;ariaLabel;ariaLabelledBy;onFocus=new W;onBlur=new W;templates;menubutton;rootmenu;startTemplate;endTemplate;menuIconTemplate;submenuIconTemplate;itemTemplate;mobileActive;outsideClickListener;resizeListener;mouseLeaveSubscriber;dirty=!1;focused=!1;activeItemPath=Me([]);number=Me(0);focusedItemInfo=Me({index:-1,level:0,parentKey:"",item:null});searchValue="";searchTimeout;_processedItems;_model;get visibleItems(){let e=this.activeItemPath().find(i=>i.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${be.isNotEmpty(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e,i,n,s,a,o,l){this.document=e,this.platformId=i,this.el=n,this.renderer=s,this.cd=a,this.config=o,this.menubarService=l,Dr(()=>{let c=this.activeItemPath();be.isNotEmpty(c)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())})}ngOnInit(){this.menubarService.autoHide=this.autoHide,this.menubarService.autoHideDelay=this.autoHideDelay,this.mouseLeaveSubscriber=this.menubarService.mouseLeft$.subscribe(()=>this.unbindOutsideClickListener()),this.id=this.id||Cn()}ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"start":this.startTemplate=e.template;break;case"end":this.endTemplate=e.template;break;case"menuicon":this.menuIconTemplate=e.template;break;case"submenuicon":this.submenuIconTemplate=e.template;break;case"item":this.itemTemplate=e.template;break;default:this.itemTemplate=e.template;break}})}createProcessedItems(e,i=0,n={},s=""){let a=[];return e&&e.forEach((o,l)=>{let c=(s!==""?s+"_":"")+l,d={item:o,index:l,level:i,key:c,parent:n,parentKey:s};d.items=this.createProcessedItems(o.items,i+1,d,c),a.push(d)}),a}getItemProp(e,i){return e?be.getItemValue(e[i]):void 0}menuButtonClick(e){this.toggle(e)}menuButtonKeydown(e){(e.code==="Enter"||e.code==="Space")&&this.menuButtonClick(e)}onItemClick(e){let{originalEvent:i,processedItem:n}=e,s=this.isProcessedItemGroup(n),a=be.isEmpty(n.parent);if(this.isSelected(n)){let{index:l,key:c,level:d,parentKey:u,item:h}=n;this.activeItemPath.set(this.activeItemPath().filter(p=>c!==p.key&&c.startsWith(p.key))),this.focusedItemInfo.set({index:l,level:d,parentKey:u,item:h}),this.dirty=!a,M.focus(this.rootmenu.menubarViewChild.nativeElement)}else if(s)this.onItemChange(e);else{let l=a?n:this.activeItemPath().find(c=>c.parentKey==="");this.hide(i),this.changeFocusedItemIndex(i,l?l.index:-1),this.mobileActive=!1,M.focus(this.rootmenu.menubarViewChild.nativeElement)}}onItemMouseEnter(e){M.isTouchDevice()||this.mobileActive||this.onItemChange(e)}changeFocusedItemIndex(e,i){let n=this.findVisibleItem(i);if(this.focusedItemInfo().index!==i){let s=this.focusedItemInfo();this.focusedItemInfo.set(j(f({},s),{item:n.item,index:i})),this.scrollInView()}}scrollInView(e=-1){let i=e!==-1?`${this.id}_${e}`:this.focusedItemId,n=M.findSingle(this.rootmenu.el.nativeElement,`li[id="${i}"]`);n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"nearest"})}onItemChange(e){let{processedItem:i,isFocus:n}=e;if(be.isEmpty(i))return;let{index:s,key:a,level:o,parentKey:l,items:c,item:d}=i,u=be.isNotEmpty(c),h=this.activeItemPath().filter(p=>p.parentKey!==l&&p.parentKey!==a);u&&h.push(i),this.focusedItemInfo.set({index:s,level:o,parentKey:l,item:d}),this.activeItemPath.set(h),u&&(this.dirty=!0),n&&M.focus(this.rootmenu.menubarViewChild.nativeElement)}toggle(e){this.mobileActive?(this.mobileActive=!1,Oi.clear(this.rootmenu.el.nativeElement),this.hide()):(this.mobileActive=!0,Oi.set("menu",this.rootmenu.el.nativeElement,this.config.zIndex.menu),setTimeout(()=>{this.show()},0)),this.cd.markForCheck(),this.bindOutsideClickListener(),e.preventDefault()}hide(e,i){this.mobileActive&&setTimeout(()=>{M.focus(this.menubutton.nativeElement)},0),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),i&&M.focus(this.rootmenu?.menubarViewChild.nativeElement),this.dirty=!1}show(){let e=this.findVisibleItem(this.findFirstFocusedItemIndex());this.focusedItemInfo.set({index:this.findFirstFocusedItemIndex(),level:0,parentKey:"",item:e?.item}),M.focus(this.rootmenu?.menubarViewChild.nativeElement)}onMenuFocus(e){this.focused=!0;let i=this.findVisibleItem(this.findFirstFocusedItemIndex()),n=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:this.findFirstFocusedItemIndex(),level:0,parentKey:"",item:i?.item};this.focusedItemInfo.set(n),this.onFocus.emit(e)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue="",this.dirty=!1,this.onBlur.emit(e)}onKeyDown(e){let i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!i&&be.isPrintableCharacter(e.key)&&this.searchItems(e,e.key);break}}findVisibleItem(e){return be.isNotEmpty(this.visibleItems)?this.visibleItems[e]:null}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}isProcessedItemGroup(e){return e&&be.isNotEmpty(e.items)}isSelected(e){return this.activeItemPath().some(i=>i.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&be.isNotEmpty(e.items)}searchItems(e,i){this.searchValue=(this.searchValue||"")+i;let n=-1,s=!1;return this.focusedItemInfo().index!==-1?(n=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(a=>this.isItemMatched(a)),n=n===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(a=>this.isItemMatched(a)):n+this.focusedItemInfo().index):n=this.visibleItems.findIndex(a=>this.isItemMatched(a)),n!==-1&&(s=!0),n===-1&&this.focusedItemInfo().index===-1&&(n=this.findFirstFocusedItemIndex()),n!==-1&&this.changeFocusedItemIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),s}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}onArrowDownKey(e){let i=this.visibleItems[this.focusedItemInfo().index];if(i?be.isEmpty(i.parent):null)this.isProccessedItemGroup(i)&&(this.onItemChange({originalEvent:e,processedItem:i}),this.focusedItemInfo.set({index:-1,parentKey:i.key,item:i.item}),this.onArrowRightKey(e));else{let s=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,s),e.preventDefault()}}onArrowRightKey(e){let i=this.visibleItems[this.focusedItemInfo().index];if(i?this.activeItemPath().find(s=>s.key===i.parentKey):null)this.isProccessedItemGroup(i)&&(this.onItemChange({originalEvent:e,processedItem:i}),this.focusedItemInfo.set({index:-1,parentKey:i.key,item:i.item}),this.onArrowDownKey(e));else{let s=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,s),e.preventDefault()}}onArrowUpKey(e){let i=this.visibleItems[this.focusedItemInfo().index];if(be.isEmpty(i.parent)){if(this.isProccessedItemGroup(i)){this.onItemChange({originalEvent:e,processedItem:i}),this.focusedItemInfo.set({index:-1,parentKey:i.key,item:i.item});let a=this.findLastItemIndex();this.changeFocusedItemIndex(e,a)}}else{let s=this.activeItemPath().find(a=>a.key===i.parentKey);if(this.focusedItemInfo().index===0){this.focusedItemInfo.set({index:-1,parentKey:s?s.parentKey:"",item:i.item}),this.searchValue="",this.onArrowLeftKey(e);let a=this.activeItemPath().filter(o=>o.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(a)}else{let a=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,a)}}e.preventDefault()}onArrowLeftKey(e){let i=this.visibleItems[this.focusedItemInfo().index],n=i?this.activeItemPath().find(s=>s.key===i.parentKey):null;if(n){this.onItemChange({originalEvent:e,processedItem:n});let s=this.activeItemPath().filter(a=>a.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(s),e.preventDefault()}else{let s=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,s),e.preventDefault()}}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide(e,!0),this.focusedItemInfo().index=this.findFirstFocusedItemIndex(),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let i=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(i)&&this.onItemChange({originalEvent:e,processedItem:i})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let i=M.findSingle(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),n=i&&M.findSingle(i,'a[data-pc-section="action"]');n?n.click():i&&i.click()}e.preventDefault()}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return be.findLastIndex(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let i=e>0?be.findLastIndex(this.visibleItems.slice(0,e),n=>this.isValidItem(n)):-1;return i>-1?i:e}findNextItemIndex(e){let i=ethis.isValidItem(n)):-1;return i>-1?i+e+1:e}bindResizeListener(){at(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{M.isTouchDevice()||this.hide(e,!0),this.mobileActive=!1})))}bindOutsideClickListener(){at(this.platformId)&&(this.outsideClickListener||(this.outsideClickListener=this.renderer.listen(this.document,"click",e=>{let i=this.rootmenu.el.nativeElement!==e.target&&!this.rootmenu.el.nativeElement.contains(e.target),n=this.mobileActive&&this.menubutton.nativeElement!==e.target&&!this.menubutton.nativeElement.contains(e.target);i&&(n?this.mobileActive=!1:this.hide())})))}unbindOutsideClickListener(){this.outsideClickListener&&(this.outsideClickListener(),this.outsideClickListener=null)}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}ngOnDestroy(){this.mouseLeaveSubscriber?.unsubscribe(),this.unbindOutsideClickListener(),this.unbindResizeListener()}static \u0275fac=function(i){return new(i||r)(S(fe),S(ut),S(Ie),S(ht),S(Ne),S(vn),S(il))};static \u0275cmp=Q({type:r,selectors:[["p-menubar"]],contentQueries:function(i,n,s){if(i&1&&rt(s,mi,4),i&2){let a;Te(a=we())&&(n.templates=a)}},viewQuery:function(i,n){if(i&1&&(Rt(g1,5),Rt(_1,5)),i&2){let s;Te(s=we())&&(n.menubutton=s.first),Te(s=we())&&(n.rootmenu=s.first)}},hostAttrs:[1,"p-element"],inputs:{model:"model",style:"style",styleClass:"styleClass",autoZIndex:[2,"autoZIndex","autoZIndex",J],baseZIndex:[2,"baseZIndex","baseZIndex",Ge],autoDisplay:[2,"autoDisplay","autoDisplay",J],autoHide:[2,"autoHide","autoHide",J],autoHideDelay:[2,"autoHideDelay","autoHideDelay",Ge],id:"id",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy"},outputs:{onFocus:"onFocus",onBlur:"onBlur"},features:[zt([il]),Be],ngContentSelectors:C1,decls:8,vars:25,consts:[["rootmenu",""],["legacy",""],["menubutton",""],[3,"ngClass","ngStyle"],["class","p-menubar-start",4,"ngIf"],["tabindex","0","role","button","class","p-menubar-button",3,"click","keydown",4,"ngIf"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","items","itemTemplate","menuId","root","baseZIndex","autoZIndex","mobileActive","autoDisplay","ariaLabel","ariaLabelledBy","focusedItemId","submenuIconTemplate","activeItemPath"],["class","p-menubar-end",4,"ngIf","ngIfElse"],[1,"p-menubar-start"],[4,"ngTemplateOutlet"],["tabindex","0","role","button",1,"p-menubar-button",3,"click","keydown"],[4,"ngIf"],[1,"p-menubar-end"]],template:function(i,n){if(i&1){let s=pt();mt(),F(0,"div",3),$(1,y1,2,1,"div",4)(2,w1,4,7,"a",5),F(3,"p-menubarSub",6,0),xe("itemClick",function(o){return ce(s),de(n.onItemClick(o))})("menuFocus",function(o){return ce(s),de(n.onMenuFocus(o))})("menuBlur",function(o){return ce(s),de(n.onMenuBlur(o))})("menuKeydown",function(o){return ce(s),de(n.onKeyDown(o))})("itemMouseEnter",function(o){return ce(s),de(n.onItemMouseEnter(o))}),O(),$(5,A1,2,1,"div",7)(6,R1,2,0,"ng-template",null,1,Ar),O()}if(i&2){let s=Ht(7);We(n.styleClass),v("ngClass",st(23,v1,n.mobileActive))("ngStyle",n.style),Z("data-pc-section","root")("data-pc-name","menubar"),I(),v("ngIf",n.startTemplate),I(),v("ngIf",n.model&&n.model.length>0),I(),v("items",n.processedItems)("itemTemplate",n.itemTemplate)("menuId",n.id)("root",!0)("baseZIndex",n.baseZIndex)("autoZIndex",n.autoZIndex)("mobileActive",n.mobileActive)("autoDisplay",n.autoDisplay)("ariaLabel",n.ariaLabel)("ariaLabelledBy",n.ariaLabelledBy)("focusedItemId",n.focused?n.focusedItemId:void 0)("submenuIconTemplate",n.submenuIconTemplate)("activeItemPath",n.activeItemPath()),I(2),v("ngIf",n.endTemplate)("ngIfElse",s)}},dependencies:()=>[xt,Ri,Yt,xi,tl,x1],styles:[`@layer primeng{.p-menubar{display:flex;align-items:center}.p-menubar ul{margin:0;padding:0;list-style:none}.p-menubar .p-menuitem-link{cursor:pointer;display:flex;align-items:center;text-decoration:none;overflow:hidden;position:relative}.p-menubar .p-menuitem-text{line-height:1}.p-menubar .p-menuitem{position:relative}.p-menubar-root-list{display:flex;align-items:center;flex-wrap:wrap}.p-menubar-root-list>li ul{display:none;z-index:1}.p-menubar-root-list>.p-menuitem-active>p-menubarsub>.p-submenu-list{display:block}.p-menubar .p-submenu-list{display:none;position:absolute;z-index:2}.p-menubar .p-submenu-list>.p-menuitem-active>p-menubarsub>.p-submenu-list{display:block;left:100%;top:0}.p-menubar .p-submenu-list .p-menuitem-link .p-submenu-icon:not(svg){margin-left:auto}.p-menubar .p-menubar-root-list .p-icon-wrapper,.p-menubar .p-submenu-list .p-menuitem-link .p-icon-wrapper{margin-left:auto}.p-menubar .p-menubar-custom,.p-menubar .p-menubar-end{margin-left:auto;align-self:center}.p-menubar-button{display:none;cursor:pointer;align-items:center;justify-content:center}} `],encapsulation:2,changeDetection:0})}return r})(),Ph=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275mod=Ce({type:r});static \u0275inj=_e({imports:[Xi,go,mu,To,ti,tl,wo,Io,go,To,ti]})}return r})();var Hs=class r{transform(t="",e=2,i){let n=typeof t=="number"?t:Number(t.replace(/,/g,""));return i===void 0?ot.roundPrice(t,e):ot.transformNumber(n,e,i)}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275pipe=ma({name:"appRoundPrices",type:r,pure:!0,standalone:!0})}};var nl="screen and (max-width: 590px)";var Oh="screen and (max-width: 1024px)";var L1=["imgTokenLogo"],k1=r=>({red:r});function P1(r,t){if(r&1&&(F(0,"div",9,1),Ee(2),O()),r&2){let e=w(2);I(2),jt(" ",e.reviewTokenSymbol(e.tokenData.symbol,e.tokenData.name)," ")}}function O1(r,t){if(r&1&&(F(0,"span"),Ee(1,"$"),O(),Ee(2),Ca(3,"appRoundPrices")),r&2){let e=w(2);I(2),jt("",va(3,1,e.tokenData.price,3)," ")}}function M1(r,t){r&1&&Ee(0," --- ")}function N1(r,t){r&1&&(F(0,"span"),Ee(1,"Powered "),O())}function F1(r,t){if(r&1&&X(0,"img",21),r&2){let e=w(2);v("src",e.getLogo(),Ki)}}function V1(r,t){r&1&&X(0,"img",22)}function $1(r,t){if(r&1){let e=pt();F(0,"a",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"div",8),$(5,P1,3,1,"div",9),F(6,"div",10)(7,"img",11,0),xe("error",function(){ce(e);let n=Ht(8),s=w();return de(s.loadAlternativeLogo(n))}),O()()(),F(9,"div",12)(10,"div",13)(11,"span"),Ee(12),O(),Ee(13),O()()(),F(14,"div",14)(15,"div",15),$(16,O1,4,4)(17,M1,1,0),O(),F(18,"div",16)(19,"span",17),Ee(20),Ca(21,"number"),O(),Ee(22," 24h "),O()(),F(23,"div",18)(24,"div",19),$(25,N1,2,0,"span"),Ee(26," by"),O(),F(27,"div",20),$(28,F1,1,1,"img",21)(29,V1,1,0,"img",22),O()()()()()}if(r&2){let e=w();v("href",e.getPairExplorerURLWithLanguage(),Ki),I(5),wt(e.tokenData.symbol&&!e.tokenData.logo?5:-1),I(2),v("src",e.tokenData.logo,Ki),I(5),jt("",e.tokenData.symbol," "),I(),jt("/ ",e.tokenData.symbol_vs," "),I(3),wt(e.tokenData!=null&&e.tokenData.price?16:17),I(3),v("ngClass",st(14,k1,e.priceVariation24h<=0)),I(),zl(" ",e.priceVariation24h>0?"+":"-"," ",va(21,11,e.getAbsValue(e.priceVariation24h),"1.2-2"),"% "),I(5),wt(e.mediaDevice==="desktop"?25:-1),I(3),wt(e.mediaDevice==="desktop"?28:29)}}var js=class r{constructor(t,e){this._breakpointObserver=t;this._cdRef=e;this.dextoolsClicked=new W;this.mediaDevice=""}ngOnInit(){this._breakpointObserver.observe([nl,Oh]).subscribe(t=>{this.mediaDevice=t.breakpoints[nl]?"mobile":"desktop",this._cdRef.detectChanges()})}ngOnChanges(t){t.tokenData!=null&&!!t.tokenData.previousValue!=!!t.tokenData.currentValue&&this.loadAlternativeLogo(this.imgTokenLogo)}getAbsValue(t){return Math.abs(t)}loadAlternativeLogo(t){t&&(this.tokenData.logo?(t.parentElement.style.display="block",t.style.display="block"):(t.parentElement.style.display="none",t.style.display="none"))}reviewTokenSymbol(t,e){return $i.getFirstValidCharacter(t,e)}getLogo(){return this.isDarkTheme?"assets/img/logo/dextools_logo_full_dark.svg":"assets/img/logo/dextools_logo_full_light.svg"}getPairExplorerURLWithLanguage(){let t=`/${this.chain}/pair-explorer/${this.pairAddress}`;return`https://dextools.io/app/${this.language}${t}`}static{this.\u0275fac=function(e){return new(e||r)(S(Ru),S(Ne))}}static{this.\u0275cmp=Q({type:r,selectors:[["app-header-pair"]],viewQuery:function(e,i){if(e&1&&Rt(L1,5),e&2){let n;Te(n=we())&&(i.imgTokenLogo=n.first)}},inputs:{language:"language",chain:"chain",tokenData:"tokenData",priceVariation24h:"priceVariation24h",isDarkTheme:"isDarkTheme",pairAddress:"pairAddress"},outputs:{dextoolsClicked:"dextoolsClicked"},standalone:!0,features:[nt,ue],decls:2,vars:0,consts:[["imgTokenLogo",""],["logoName",""],["styleClass","header-pair"],["pTemplate","start"],["target","_blank",3,"href"],[1,"header-pair__first-part"],[1,"pair-info"],[1,"pair-info__container"],[1,"pair-info__logo"],[1,"name-icon"],[1,"img-container"],["alt","token logo",1,"img-token",3,"error","src"],[1,"pair-info__token"],[1,"pair-info__symbols"],[1,"pair-info__data"],[1,"pair-info__volume"],[1,"pair-info__variation"],[3,"ngClass"],[1,"pair-info__powered"],[1,"pair-info__credits"],[1,"pair-info__credits-logo"],["alt","Dextools Logo","fetchpriority","high",3,"src"],["src","assets/img/logo/dextools_logo.png","alt","Dextools Logo","fetchpriority","high"]],template:function(e,i){e&1&&(F(0,"p-menubar",2),$(1,$1,30,16,"ng-template",3),O())},dependencies:[Ph,kh,mi,ti,kr,xt,tc,Hs],styles:["[_nghost-%COMP%] .header-pair{height:2.8571428571rem;padding:0 .5rem;border-radius:0;border-width:.0714285714rem;border-color:var(--custom-header-border-color)}[_nghost-%COMP%] .header-pair a{text-decoration:none}[_nghost-%COMP%] .header-pair .p-menubar-start{flex-grow:1}[_nghost-%COMP%] .header-pair .p-menubar-button{display:none}[_nghost-%COMP%] .header-pair__first-part{display:flex;align-items:center}[_nghost-%COMP%] .header-pair__first-part .pair-info{display:flex;height:100%;width:100%;padding:0rem .5rem;box-sizing:border-box;align-items:center;justify-content:space-between}[_nghost-%COMP%] .header-pair__first-part .pair-info__container{display:flex;align-items:center}[_nghost-%COMP%] .header-pair__first-part .pair-info__logo{margin-right:.5rem;width:2rem;height:2rem;border-radius:50%;overflow:hidden;position:relative;flex:0 0 2rem}[_nghost-%COMP%] .header-pair__first-part .pair-info__logo .img-container{width:2rem;height:2rem;border-radius:50%;position:relative;overflow:hidden}[_nghost-%COMP%] .header-pair__first-part .pair-info__logo img{width:auto;height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}[_nghost-%COMP%] .header-pair__first-part .pair-info__logo .name-icon{width:2rem;height:2rem;background-color:#23323c;color:#fff9;font-size:1.1428571429rem;line-height:2rem;text-align:center;position:absolute;top:0;left:0}[_nghost-%COMP%] .header-pair__first-part .pair-info__token{flex:auto;width:10.3571428571rem;display:flex;flex-flow:column;justify-content:space-between}@media (max-width: 590px){[_nghost-%COMP%] .header-pair__first-part .pair-info__token{width:5.7142857143rem}}[_nghost-%COMP%] .header-pair__first-part .pair-info__symbols{font-size:1rem;color:var(--text-color-secondary);line-height:1.1428571429rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}[_nghost-%COMP%] .header-pair__first-part .pair-info__symbols span{color:var(--text-color)}[_nghost-%COMP%] .header-pair__first-part .pair-info__favourite{align-self:center;margin-right:.5rem}[_nghost-%COMP%] .header-pair__first-part .pair-info__favourite fa-icon{font-size:2rem}[_nghost-%COMP%] .header-pair__first-part .pair-info__data{display:flex;flex-flow:row;justify-content:space-between;align-items:flex-end;gap:.5rem}@media (max-width: 590px){[_nghost-%COMP%] .header-pair__first-part .pair-info__data{flex:1;align-items:center;justify-content:center}}[_nghost-%COMP%] .header-pair__first-part .pair-info__volume{font-size:1.25rem;font-weight:600;line-height:1.1428571429rem;color:var(--text-color)}[_nghost-%COMP%] .header-pair__first-part .pair-info__variation{font-size:1rem;color:var(--text-color-secondary);line-height:1rem}[_nghost-%COMP%] .header-pair__first-part .pair-info__variation span{color:var(--text-success-color)}[_nghost-%COMP%] .header-pair__first-part .pair-info__variation span.red{color:var(--text-danger-color)}[_nghost-%COMP%] .header-pair__first-part .pair-info__powered{display:flex;gap:.5714285714rem;align-items:center}[_nghost-%COMP%] .header-pair__first-part .pair-info__credits{text-transform:lowercase;font-size:.7142857143rem;color:var(--text-color-secondary)}[_nghost-%COMP%] .header-pair__first-part .pair-info__credits-logo{display:flex;align-items:center;cursor:pointer}[_nghost-%COMP%] .header-pair__first-part .pair-info__credits-logo img{width:6rem;height:auto}@media (max-width: 590px){[_nghost-%COMP%] .header-pair__first-part .pair-info__credits-logo img{width:1.4285714286rem}}"],changeDetection:0})}};var Ci=class r{constructor(t,e){this._rendererFactory=t;this._lazyCss=e;this.isDarkTheme=!0}initialize(t,e){this._document=t,this._renderer=e??this._rendererFactory.createRenderer(null,null)}switchTheme(t){t==="dark"?(this._renderer.addClass(this._document.body,"dark-theme"),t="lara-dark-cyan",this.isDarkTheme=!0):(this._renderer.removeClass(this._document.body,"dark-theme"),t="lara-light-cyan",this.isDarkTheme=!1),this._lazyCss.loadCss(this._document,"appTheme",`${t}.css`)}getTheme(){return this.isDarkTheme?0:1}static{this.\u0275fac=function(e){return new(e||r)(D(qi),D(os))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var U1=1,zs=class r{constructor(t){this._apiService=t;this._oldestCandlesTimeCached=new Map;this._headers=j(f({},this._apiService.headers),{"X-API-Version":U1})}getOnTheFlyCandles(t,e,i,n,s,a){let o=y.getLegacyChain(s),l=`tz=${n}`,c=`ts=${Math.round(Date.now()/1e3)}`,d=this._getSupportedApiResolution(i);+i>=1440&&(l="tz=0");let u=pi.encodeStringAsURIComponent(t);return this._apiService.get(g.CORE_API,`/pool/candles/${o}/${u}/${e}/${d}/${a}/latest?${c}&${l}`,void 0,new Qt(this._headers)).pipe(R(h=>({candles:h.data.candles,nextTs:this._convertSecondsToMilliseconds(h.data.next?.ts),firstTs:this._convertSecondsToMilliseconds(h.data.first),symbol:h.data.symbol})))}getCandles(t,e,i,n,s,a,o){let l=`ts=${Math.round(n/1e3)}`,c=y.getLegacyChain(a),d=o==null?"":`tz=${o}`,u=this._getSupportedApiResolution(i);+i>=1440&&(d="tz=0");let h=pi.encodeStringAsURIComponent(t);return this._apiService.get(g.CORE_API,`/pool/candles/${c}/${h}/${e}/${u}/${s}?${l}&${d}`,void 0,new Qt(this._headers)).pipe(R(p=>({candles:p.data.candles,nextTs:this._convertSecondsToMilliseconds(p.data.next?.ts),firstTs:this._convertSecondsToMilliseconds(p.data.first),symbol:p.data.symbol})))}getCandlesByAmount(t,e,i,n,s,a,o){let l=`ts=${Math.round(n/1e3)}`,c=y.getLegacyChain(s),d=o==null?"":`tz=${o}`,u=this._getSupportedApiResolution(i);return+i>=1440&&(d="tz=0"),this._apiService.get(g.CORE_API,`/pool/candles/${c}/${t}/${e}/${u}/${a}/amount?${l}&${d}`,void 0,new Qt(this._headers)).pipe(R(h=>({candles:h.data.candles,nextTs:this._convertSecondsToMilliseconds(h.data.next?.ts),firstTs:this._convertSecondsToMilliseconds(h.data.first),symbol:h.data.symbol})))}getOldestCandlesTime(t,e){let i=y.getLegacyChain(t),n=`${t}-${e}`,s=this._oldestCandlesTimeCached.get(n);if(s)return C(s);let a=pi.encodeStringAsURIComponent(e);return this._apiService.get(g.CORE_API,`/pool/candles/${i}/${a}/info`,void 0,new Qt(this._headers)).pipe(R(o=>o.data),H(o=>{o?.oldestCandle&&this._oldestCandlesTimeCached.set(n,o)}))}_convertSecondsToMilliseconds(t){return t?t*1e3:void 0}_getSupportedApiResolution(t){switch(t){case"1440":return"1d";case"720":case"240":case"120":case"60":return`${+t/60}h`;case"30":case"15":case"5":case"3":return`${t}m`;case"1S":return"1s";default:return"1m"}}static{this.\u0275fac=function(e){return new(e||r)(D(et))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var En=class r{constructor(){this._exchange=Qi;this._chain=null;this.exchange$=new te(this._exchange);this.chain$=new te(this._chain)}get exchange(){return this._exchange}set exchange(t){if(this._exchange!==t&&(this._exchange=t,this.exchange$.next(t)),this.chain!=null){let i=!!Ve.getExchangesFromChain(this.chain).some(n=>n.name.toLowerCase()===t.toLowerCase());this.exchange!==Qi&&!i&&console.warn(`Current exchange ${this.exchange} does not exist in chain ${this.chain}`)}}get exchangeApi(){return Ve.getExchangeApiFromExchange(this.exchange,this.chain)}get chain(){return this._chain}set chain(t){this._chain!==t&&(this._chain=t,this.chain$.next(t),(Ve.chainExchangeList[t??"ether"]??[]).length>0&&(Ve.getExchangesFromChain(t??"ether").some(n=>n.name.toLowerCase()===this.exchange.toLowerCase())||(this.exchange=Ve.getDefaultExchange(t??"ether"))))}get isBsc(){return this.chain==="bnb"}get isEthereum(){return this.chain==="ether"}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var B1=":common";var Gs=class r{constructor(){this._coinPrice$=new te(null);this.coinPrice$=this._coinPrice$.asObservable().pipe(me(t=>t!=null),Si());this._priceVariation24h$=new te(null);this.priceVariation24h$=this._priceVariation24h$.asObservable().pipe(me(t=>t!=null),Si());this._gasValue$=new te(null);this.gas$=this._gasValue$.asObservable().pipe(me(t=>t!=null),Si((t,e)=>JSON.stringify(t)===JSON.stringify(e)));this._wsPriceAndGasSubscription=null;this._webSocketService=b(nn);this._exchangeService=b(En)}initialize(t){this._listenPriceAndGasValues(t),this._currentChain=t,this._connectToCommonWsChain()}getPriceETH(){try{return this._coinPrice$.getValue()??0}catch{return 0}}_connectToCommonWsChain(){$t([this._webSocketService.isConnected$(),this._exchangeService.chain$.asObservable()]).subscribe(([t,e])=>{if(!t&&this._wsPriceAndGasSubscription){this._resetCoinPriceData();return}e!==null&&t&&(this._currentChain!==e||!this._wsPriceAndGasSubscription)&&(this._currentChain=e,this._wsPriceAndGasSubscription&&this._resetCoinPriceData(),this._listenPriceAndGasValues(this._currentChain))})}_resetCoinPriceData(){this._wsPriceAndGasSubscription?.unsubscribe(),this._wsPriceAndGasSubscription=null,this._coinPrice$.next(null),this._priceVariation24h$.next(null),this._gasValue$.next(null)}_listenPriceAndGasValues(t){t&&(this._chainData=y.getChainData(t),this._wsPriceAndGasSubscription=this._webSocketService.listenWebSocket(`${this._chainData.chainPrefix}${B1}`,{chain:t}).subscribe({next:e=>{if(this._isFirstEmission(e)){e.ethPrice&&this._isCoinPriceEmission(e.ethPrice)&&e.ethPrice.ethPriceUsd!=null&&this._coinPrice$.next(e.ethPrice.ethPriceUsd),e.ethPriceVariation24h&&this._isPriceVariation24hEmission(e.ethPriceVariation24h)&&e.ethPriceVariation24h.variation24h!=null&&this._priceVariation24h$.next(e.ethPriceVariation24h.variation24h),this._gasValue$.next(e.gasPrice);return}if(this._isCoinPriceEmission(e)){this._coinPrice$.next(e.ethPriceUsd);return}if(this._isPriceVariation24hEmission(e)){this._priceVariation24h$.next(e.variation24h);return}this._isGasPriceEmission(e)&&this._gasValue$.next(e)},error:e=>{this._coinPrice$.error(`CoinPrice: could not connect to real-time data source. ${e}`),this._priceVariation24h$.error(`PriceVariation24h: could not connect to real-time data source. ${e}`),this._gasValue$.error(`GasValue: could not connect to real-time data source. ${e}`)}}))}_isFirstEmission(t){return"ethPrice"in t}_isGasPriceEmission(t){return"safeGasPrice"in t}_isCoinPriceEmission(t){return"ethPriceUsd"in t}_isPriceVariation24hEmission(t){return"variation24h"in t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var Ks=class r{constructor(t){this._apiService=t}getPageConfig$(t){let e=`?key=${t}`;return this._apiService.get(g.SHARED,`/config${e}`).pipe(R(i=>{delete i.data.key;let n=i.data,s={};for(let a in n)if(!this._isConfigKeysObject(n[a]))s[a]=n[a];else{s[a]=s[a]??{};let o=n[a],l=s[a];if(o.chains){l.chains=o.chains;for(let c of l.chains)c.slug=y.replaceLegacyChain(c.slug)}else for(let c in o){let d=y.replaceLegacyChain(c);l[d]=o[c]}}return s}))}getCategoriesConfig$(t){let e=`?key=${t}`;return this._apiService.get(g.SHARED,`/config${e}`).pipe(R(i=>i.data.categories))}getExchangesConfig$(t){let e=`?key=${t}`;return this._apiService.get(g.SHARED,`/config${e}`)}_isConfigKeysObject(t){return typeof t=="object"&&t!==null}static{this.\u0275fac=function(e){return new(e||r)(D(et))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var j1=6*Ke,Nh="categories-config",Fh="categories-config-timestamp",vi=class r{constructor(t){this._configPagesApiService=t;this._configPages={};this._categories=[];this._exchanges={};this._chainsWithExchanges=[];this._fetchCategoriesSubject$=new B;this._categoriesConfigLoaded$=new te(void 0);this._cacheSubscribe=Date.now();this._fetchCategoriesSubject$.pipe(ee(()=>this.fetchCategoriesConfig$(!0))).subscribe()}fetchConfigFromPage$(t){return this._configPagesApiService.getPageConfig$(t).pipe(H(e=>this._configPages=e))}fetchCategoriesConfig$(t=!1){let e=ne.get(Nh),i=ne.getString(Fh),n=Date.now();return e&&i&&!t&&n-Number.parseInt(i,10)(ne.setString(Nh,JSON.stringify(this._mapCategories(s))),ne.setString(Fh,n.toString()),this._categoriesConfigLoaded$.next(),this._categories=this._mapCategories(s))),Gi(1),ge(()=>(this._categoriesConfigLoaded$.next(),C([]))))}_mapCategories(t){let e=[];for(let i of t)e.push({id:i.id,name:i.name,smallImage:`${Ji}/resources/categories/${i.smallImage}`,mediumImage:`${Ji}/resources/categories/${i.mediumImage}`});return e}isFeatureAvailableForChain(t,e){return!!(Object.keys(this._configPages).length===0||this._configPages[e]===!0||this._configPages[e]&&this._configPages[e][t])}getChainsByFeature(t){return this._configPages[t]?this._configPages[t].chains.map(e=>y.replaceLegacyChain(e.slug)):[]}getChainsByFeatureMemeBoard(){return this._configPages[Vs]?Object.keys(this._configPages[Vs]).filter(t=>this.isFeatureAvailableForChain(t,Vs)).map(t=>y.replaceLegacyChain(t)):[]}getChainsByFeatureKols(){return["solana"]}triggerFetchCategories(){this._fetchCategoriesSubject$.next(null)}getCategoriesConfigLoaded$(){return this._categoriesConfigLoaded$.asObservable()}getConfigPages(){return this._configPages}getCategoriesConfig(){return this._categories}getExchangesConfig(t){let e=y.getLegacyChain(t);return e?this._exchanges[e]:this._exchanges}getChainsWithExchangesConfig(){return this._chainsWithExchanges}fetchExchangesConfig$(){return this._configPagesApiService.getExchangesConfig$("exchange-fun").pipe(H(t=>{this._chainsWithExchanges=t.data.chains,this._exchanges=t.data.exchanges}),ge(()=>C(null)))}static{this.\u0275fac=function(e){return new(e||r)(D(Ks))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var qs=class{constructor(t,e,i,n){this._injector=t;this._chain=e;this._apiUrl=i;this._apiExchange=n;this.isThirdPartyApi=!1;this._appVersion=this._injector.get(Dt).appVersion,this._apiService=this._injector.get(et),this._exchangeService=this._injector.get(En)}get apiExchange(){return this._apiExchange}get apiUrl(){return this._apiUrl}get chain(){return this._chain}getSwaps(t,e,i=!1){return this._getCall(`/${this.apiExchange}/1/pairexplorer?v=${this._appVersion}&pair=${t}&ts=${e}${i?"&h=1":""}`)}getOnTheFlyCandles(t,e,i,n,s){let a=y.getLegacyChain(s),o=`&timezone=${n}`,l;switch(i){case"15":{l=`latest=${i}m`;break}case"1440":{l="latest=1d";break}case"1S":{l="latest=1s";break}default:{l="latest=1m";break}}return l==="latest=1m"&&(o=""),this._getCall(`/${this.apiExchange}/history/candles/v4?chain=${a}&${l}&pair=${t}&sym=${e}${o}`).pipe(R(c=>c.data))}getCandles(t,e,i,n,s,a,o,l){let c=y.getLegacyChain(a),d=`&ts=${n+(l||0)*60*6e4*-1}`,u=o==null?"":`&v=${o}`,h=l==null?"":`&timezone=${l}`,p;switch(i){case"15":{p=`&res=${i}m`;break}case"1440":{p="&res=1d";break}case"1S":{p="&res=1s";break}default:{p="";break}}return p===""&&s==="day"&&(h="",d=`&ts=${n}`),this._getCall(`/${this.apiExchange}/history/candles/v4?chain=${c}&sym=${e}&span=${s}&pair=${t}${d}${u}${p}${h}`).pipe(R(m=>m.data))}getTransactionStatus(t){return this._getCall(`/${this.apiExchange}/1/pairexplorer-status?pair=${t}`)}getTokenWallet(t,e){return t=y.getLegacyChain(t),this._getCallShared(`/wallet/balance?chain=${t}&address=${e}`)}getTxWallet(t,e){return t=y.getLegacyChain(t),this._getCallShared(`/wallet/transactions?chain=${t}&address=${e}`)}_getCall(t,e){return this._apiService.get(this.apiUrl,t,e)}_getCallShared(t,e){return this._apiService.get(g.SHARED,t,e)}};var z1=/([\s.-])/g;function T(r,t){return class extends qs{constructor(i){super(i,r,t,"generic")}}}var An=class An{constructor(t,e){this._apiService=t;this._injector=e;this._chainsApiAdapters=new Map([["ether",T("ether",g.API_ETHEREUM)],["bnb",T("bnb",g.API_BNB)],["polygon",T("polygon",g.API_POLYGON)],["fantom",T("fantom",g.API_FANTOM)],["cronos",T("cronos",g.API_CRONOS)],["avalanche",T("avalanche",g.API_AVALANCHE)],["metis",T("metis",g.API_METIS)],["kucoin",T("kucoin",g.API_KUCOIN)],["optimism",T("optimism",g.API_OPTIMISM)],["arbitrum",T("arbitrum",g.API_ARBITRUM)],["celo",T("celo",g.API_CELO)],["telos",T("telos",g.API_TELOS)],["moonbeam",T("moonbeam",g.API_MOONBEAM)],["fuse",T("fuse",g.API_FUSE)],["oktc",T("oktc",g.API_OKTC)],["solana",T("solana",g.API_SOLANA)],["dogechain",T("dogechain",g.API_DOGE)],["canto",T("canto",g.API_CANTO)],["etc",T("etc",g.API_ETC)],["gnosis",T("gnosis",g.API_GNOSIS)],["arbitrumnova",T("arbitrumnova",g.API_ARBITRUMNOVA)],["conflux",T("conflux",g.API_CONFLUX)],["elastos",T("elastos",g.API_ELASTOS)],["ronin",T("ronin",g.API_RONIN)],["viction",T("viction",g.API_VICTION)],["kava",T("kava",g.API_KAVA)],["ethw",T("ethw",g.API_ETHW)],["alvey",T("alvey",g.API_ALV)],["aptos",T("aptos",g.API_APTOS)],["multiversx",T("multiversx",g.API_MULTIVERSX)],["flare",T("flare",g.API_FLARE)],["pom",T("pom",g.API_POM)],["ultron",T("ultron",g.API_ULTRON)],["energi",T("energi",g.API_ENERGI)],["coredao",T("coredao",g.API_CORE_DAO)],["zksync",T("zksync",g.API_ZKSYNC)],["polygonzkevm",T("polygonzkevm",g.API_POLYGONZKEVM)],["pulse",T("pulse",g.API_PULSE)],["kaia",T("kaia",g.API_KAIA)],["linea",T("linea",g.API_LINEA)],["base",T("base",g.API_BASE)],["mantle",T("mantle",g.API_MANTLE)],["bitrock",T("bitrock",g.API_BITROCK)],["opbnb",T("opbnb",g.API_OPBNB)],["shibarium",T("shibarium",g.API_SHIBARIUM)],["scroll",T("scroll",g.API_SCROLL)],["manta",T("manta",g.API_MANTA)],["kujira",T("kujira",g.API_KUJIRA)],["blast",T("blast",g.API_BLAST)],["osmosis",T("osmosis",g.API_OSMOSIS)],["xlayer",T("xlayer",g.API_XLAYER)],["mode",T("mode",g.API_MODE)],["ton",T("ton",g.API_TON)],["near",T("near",g.API_NEAR)],["hedera",T("hedera",g.API_HEDERA)],["tron",T("tron",g.API_TRON)],["bitlayer",T("bitlayer",g.API_BITLAYER)],["apechain",T("apechain",g.API_APECHAIN)],["elysium",T("elysium",g.API_ELYSIUM)],["cronoszkevm",T("cronoszkevm",g.API_CRONOSZKEVM)],["iotaevm",T("iotaevm",g.API_IOTAEVM)],["worldchain",T("worldchain",g.API_WORLDCHAIN)],["chiliz",T("chiliz",g.API_CHILIZ)],["icp",T("icp",g.API_ICP)],["xrpl",T("xrpl",g.API_XRPL)],["sonic",T("sonic",g.API_SONIC)],["ink",T("ink",g.API_INK)],["xdc",T("xdc",g.API_XDC)],["pawchain",T("pawchain",g.API_PAWCHAIN)],["abstract",T("abstract",g.API_ABSTRACT)],["berachain",T("berachain",g.API_BERACHAIN)],["unichain",T("unichain",g.API_UNICHAIN)],["units",T("units",g.API_UNITS)],["soneium",T("soneium",g.API_SONEIUM)],["hyperevm",T("hyperevm",g.API_HYPEREVM)],["sui",T("sui",g.API_SUI)],["vsc",T("vsc",g.API_VSC)],["story",T("story",g.API_STORY)],["odyssey",T("odyssey",g.API_ODYSSEY)],["gravityalpha",T("gravityalpha",g.API_GRAVITYALPHA)],["shido",T("shido",g.API_SHIDO)],["superseed",T("superseed",g.API_SUPERSEED)],["etherlink",T("etherlink",g.API_ETHERLINK)],["utwou",T("utwou",g.API_UTWOU)],["nibiruevm",T("nibiruevm",g.API_NIBIRUEVM)],["sei",T("sei",g.API_SEI)],["plasma",T("plasma",g.API_PLASMA)],["qubic",T("qubic",g.API_QUBIC)],["monad",T("monad",g.API_MONAD)]]);this._supportedApis=new Map([]);this._apiAdapters=new Map;for(let[i,n]of this._chainsApiAdapters.entries())this._supportedApis.set(`${i.toLowerCase()}-generic`,n)}getAdapter(t,e){let i=e?`-${e.toLowerCase().replace(z1,"")}`:"",n=`${t.toLowerCase()}${i}`;if(e?this._supportedApis.has(n)||(n=`${t.toLowerCase()}-generic`):n=`${n.toLowerCase()}-generic`,this._apiAdapters.has(n))return this._apiAdapters.get(n);let s=this._supportedApis.get(n),a=this._isGenericChainAdapter(s)?new s(this._injector):new s(this._injector,i.replace("-",""));return this._apiAdapters.set(n,a),a}getAdapterForDefaultExchangeLegacy(){return this.getAdapter("ether")}fetchExchanges(t){let e={allowUnknowns:!1};t&&(e.chain=y.getLegacyChain(t));let i=new ya({fromObject:f({},e)});return this._apiService.get(g.SHARED,"/exchanges/v2",i).pipe(R(n=>{let s=this.formatResponseV2toV1(n),a={};for(let o of s){for(let l of o.data)l.limitBotSupported=!1;if(en.includes(y.replaceLegacyChain(o.chain)))if(Nn.includes(o.chain)){let l=y.replaceLegacyChain(o.chain),c=o.data;for(let d of c)d.chainId=l,d.chain=l;a[l]=[...c]}else a[o.chain]=o.data}return a}),ge(()=>C({})))}formatResponseV2toV1(t){let{data:e}=t,i=[];for(let n of e){let s=n.exchanges.map(a=>j(f({},a),{chainId:n.chain,isDefault:a.isDefault??!1,urlInfo:a.urlInfo??"",urlSwap:a.urlSwap??""}));i.push({chain:n.chain,data:s})}return i}_isGenericChainAdapter(t){return[...this._chainsApiAdapters.values()].includes(t)}fetchSlugsOrderBySwaps(t){let e=y.getLegacyChain(t),i=j(f({},this._apiService.headers),{"X-API-Version":1}),n=new ya;return this._apiService.get(g.CORE_API,`/exchange/marquee/${e}`,n,new Qt(i))}getExchangesOrderBySwaps(t,e){return e?this.fetchSlugsOrderBySwaps(t).pipe(ie(1),R(i=>Ve.sortExchangesBySlugs(e,i))):C([])}static{this.\u0275fac=function(e){return new(e||An)(D(et),D(Zt))}}static{this.\u0275prov=E({token:An,factory:An.\u0275fac,providedIn:"root"})}};Ze([Je({resolver:(...t)=>`${t[0]}(${t[1]})`.toLowerCase(),clearSignal:Ve.exchangesChanged$})],An.prototype,"getAdapter",1);var Zs=An;var Xs=class r{constructor(){this._configPagesService=b(vi)}getCategories(t){let e=this._configPagesService.getCategoriesConfig();return t.filter(n=>!e.some(s=>s.id===n)).length>0&&this._configPagesService.triggerFetchCategories(),this._mapCategoriesFromConfig(t,e)}_mapCategoriesFromConfig(t,e){return e.filter(({id:i})=>t.includes(i))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var W1=1,Ys=class r{constructor(t){this._apiService=t;this._representativePairs={};this._headers=j(f({},this._apiService.headers),{"X-API-Version":W1})}getRepresentativePairByToken(t,e){let i=`${e}-${t}`;if(this._representativePairs[i])return C(this._representativePairs[i]);{let n=["id","name","symbol","decimals","creationBlock","creationTime","totalSupply","metrics","audit","locks","info","links","logo"],a=`?tokens=${y.getLegacyChain(e)}:${t}&ignoreFields=${n}`;return this._apiService.get(g.SHARED,`${wh}${a}`).pipe(R(o=>{if(o.data&&o.data.length>0){let l=o.data[0];return l===null||Object.keys(l).length===0||!l.reprPair?.id?null:(this._representativePairs[i]=l.reprPair,this._representativePairs[i])}return null}))}}getAllAliasData(t,e=!1,i=!0){let n=`alias=${t}`,s=`audit=${e}`,a=`locks=${i}`,o=`${n}&${s}&${a}`;return this._getPairOrAliasData(o).pipe(R(l=>l.data===null?null:{chain:y.replaceLegacyChain(l.data[0].id.chain),pair:l.data[0].id.pair,alias:l.data[0].alias??""}))}getAllPairData(t,e,i=!1,n=!0){let a=`chain=${y.getLegacyChain(e)}`,o=`address=${t}`,l=`audit=${i}`,c=`locks=${n}`,d=`${o}&${a}&${l}&${c}`;return this._getPairOrAliasData(d).pipe(R(u=>u.data===null?null:u.data[0]))}getPairSummary(t,e){let i=y.getLegacyChain(e);return this._apiService.get(g.CORE_API,`/pool/summary/${i}?address=${t}&showCandles=true`,void 0,new Qt(this._headers)).pipe(R(n=>n.data))}_getPairOrAliasData(t){return this._apiService.get(g.SHARED,`${Th}?${t}`,void 0,void 0)}static{this.\u0275fac=function(e){return new(e||r)(D(et))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var Qs=class r{constructor(){this._pairsApiService=b(Ys);this._categoriesService=b(Xs)}getRepresentativePairByToken(t,e){return this._pairsApiService.getRepresentativePairByToken(t,e)}getAllPairData(t,e,i=!1,n=!0){return this._pairsApiService.getAllPairData(t,e,i,n).pipe(R(s=>{if(s!=null){let a=y.replaceLegacyChain(s.id.chain);return j(f({},s),{price5m:this._setMaxPoolDataValue(s.price5m,s,[]),price1h:this._setMaxPoolDataValue(s.price1h,s,["price5m"]),price6h:this._setMaxPoolDataValue(s.price6h,s,["price1h","price5m"]),price24h:this._setMaxPoolDataValue(s.price24h,s,["price6h","price1h","price5m"]),id:j(f({},s.id),{chain:a}),token:j(f({},s.token),{categories:s.token.categories?this._categoriesService.getCategories(s.token.categories):[],id:j(f({},s.token.id),{chain:y.replaceLegacyChain(s.token.id.chain)}),audit:$s.mapAudits(s,y.getChainData(a))}),fee:+ot.transformNumber(s.fee,0,3,!1),startBondingCurve:s.migratedFrom?Math.floor(new Date(s.migratedFrom.date).getTime()/1e3):void 0})}return null}))}_setMaxPoolDataValue(t,e,i){for(let n of i)e[n]&&(t?.volume??0)<(e[n]?.volume??0)&&(t=e[n]);return t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};function q1(r,t){if(r&1){let e=pt();X(0,"app-header-pair",1),F(1,"app-trading-view",2,0),xe("liveCandlesCleared",function(n){ce(e);let s=w();return de(s._emitLiveCandles(n.candles))})("fullScreenToggled",function(){ce(e);let n=w();return de(n.openFullScreen(!1))})("tvReady",function(n){ce(e);let s=Ht(2),a=w();return de(a.registerWidget(n,s))})("tvDestroyed",function(){ce(e);let n=Ht(2),s=w();return de(s.unregisterWidget(n))}),O()}if(r&2){let e=w();v("tokenData",e.tokenData)("priceVariation24h",e.priceVariation24h)("language",e.language)("isDarkTheme",e.isDarkTheme)("chain",e.chain)("pairAddress",e.pairId),I(),v("chartApiAdapter",e.chartApiAdapter)("chartApiV2Adapter",e.chartApiV2Adapter)("chartSettingsStorage",e.chartSettingsStorage)("showMarketCapButton",!!e.chartTokenData.supply)("clientId",e.chartClientId)("tokenData",e.chartTokenData)("refTokenSymbol",e.chartRefTokenSymbol)("exchange",e.exchange)("candlesData",e.candlesData)("pairSelected",e.pairId)("latestCandles$",e.latestCandles)("darkThemeUrl","css/custom_dext_light_dark.css")("lightThemeUrl","css/custom_dext_light.css")("isFullScreen",e.isFullScreen)("isDarkTheme",e.isDarkTheme)("isUserIdEnabled",!1)("showTokenRefChangeButton",e.showTokenRefChangeButton)("showMinMaxButtons",e.showMinMaxButtons)("chartResolution",e.chartResolution)("chartType",e.chartTypeUrl)("showLeftToolbar",e.drawingToolbarsActive)("chain",e.chain)("secondsResolutionsEnabled",!1)}}var Vh=3e4,Z1=":pair:",$h="tradingview",sl="chartSavedStateWidget",fr=class r{constructor(t,e,i,n,s,a,o,l,c,d,u,h,p,m){this._exchangeApiService=t;this._pairsService=e;this._cdRef=i;this._commonService=n;this._chartService=s;this._webSocketService=a;this._candlesDataService=o;this._priceTrackService=l;this._actRoute=c;this._injector=d;this._routingService=u;this._settingsService=h;this._themeService=p;this._configPagesService=m;this.isDarkTheme=!0;this.urlPreviewTV=null;this.isFullScreen=!1;this._timePetitionsTx=6e3;this._timePetitionsTxRecon=5e3;this.pairSelected=null;this.exchangeVersion=null;this._allPairData=null;this.tokenData={holders:0,txCount:0,decimals:0,pooledToken:0,pooledETH:0,liquidity:void 0,liquidityPoolToken:{},priceUSD:0,priceETH:0,created:0,isStableNativePair:!1,pairType:"standard-pair",isFromTokenCreator:!1,stories:[],categories:[]};this.chartTokenData={symbol:"",isStableSymbol:!1,created:0};this._transactionsBuffer=[];this.abortDataTransactions$=new B;this._isPairLoaded$=new te(!1);this.isWsConnected=!1;this._isSubscribed=!1;this._dataTransactions=[];this.initCharge=!0;this.loader=!0;this.loaderTv=!0;this.isSynced=!1;this._exitComponent=!1;this._pairTV=null;this._dataTransactionsApi=[];this._optimalDecimalsUsd=8;this.latestCandles=new te([]);this._lastTimestamp=0;this._lastTimestampOffset=0;this._lastTimestampUniqueTrx=[];this._isPoolLoaded=!1;this._maxReconnTimes=3;this._reconnTimes=0;this.noTransactions=!1;this._dataTransactionsTemp=[];this._numberOfTxShow=1e5;this.showTokenRefChangeButton=!0;this.showMinMaxButtons=!1;this.language="en";this.chartResolution=null;this.chartTypeUrl=null;this.drawingToolbarsActive=!0;this._chartInUsd=!0;this.chartApiV2Adapter=null;this.chartApiAdapter=null;this.chartSettingsStorage={savedPropertiesKey:"chartpropertieswidget",savedStateKey:"chartSavedStateWidget",storeSetting:(t,e,i)=>{if(i)throw new Error("TradingView: wrong config, multi chart is not supported in this page");if(t==="latestResolution"){this._candlesDataService.updateResolution(e);return}this._storeChartSetting(t,e)},getStoredSetting:(t,e)=>{if(e)throw new Error("TradingView: wrong config, multi chart is not supported in this page");return t==="latestResolution"?this._candlesDataService.latestResolution:this._getStoredChartSetting(t)}};this.chartRefTokenSymbol="";this._bufferLiveSwapsUntilChartReady=Me(!0);this._swapsReceivedBeforeChartReady=[];this.isFullTradeHistorySupported=!1;this._destroyRef=b(Tr);this._pairFromRoute=yu("currentPair",{type:"data"});this.tokenPoolInfo={value:"",tokenSymbol:"",vsSymbol:"",totalSupply:0,fee:0};this.chain=this._pairFromRoute?.chain,this.isFullTradeHistorySupported=this._configPagesService.isFeatureAvailableForChain(this.chain,"full_history");let A=this._exchangeApiService.getAdapter(this.chain);this.isFullTradeHistorySupported?(this._candlesApiService=this._injector.get(zs),this.chartApiV2Adapter={getOnTheFlyCandles:this._candlesApiService.getOnTheFlyCandles.bind(this._candlesApiService),getCandles:this._candlesApiService.getCandles.bind(this._candlesApiService),getCandlesByAmount:this._candlesApiService.getCandlesByAmount.bind(this._candlesApiService),getOldestCandleDate:this._candlesApiService.getOldestCandlesTime.bind(this._candlesApiService)}):this.chartApiAdapter={getOnTheFlyCandles:A.getOnTheFlyCandles.bind(A),getCandles:A.getCandles.bind(A)},this.chartRefTokenSymbol=y.getRefTokenSymbol(this.chain),this.isDarkTheme=this._themeService.isDarkTheme,this._commonService.initialize(this.chain),this.chain==="solana"?this._web3SolanaUtilsService=this._injector.get(Bc):this._web3UtilsService=this._injector.get(Hc),this.refTokenSymbol=y.getRefTokenSymbol(this.chain),this._chainData=y.getChainData(this.chain),this._chainScannerData=this._chainData.scanner,this._settingsService.getConfigChanged$("language").subscribe(_=>this.language=_)}onMouseDown(){this._pairTV?.widgetInstance&&this._pairTV.widgetInstance.takeClientScreenshot({hideResolution:!1}).then(t=>{this.urlPreviewTV=t.toDataURL(),this._cdRef.detectChanges()})}onDocumentClicked(t,e){if(e&&!e.closest(".options-container")){let i=document.querySelectorAll(".options-container.selected");i.length>0&&i[0].classList.remove("selected")}}ngOnDestroy(){this._candlesDataService.clearCachedChartById(this.pairId),this.latestCandles&&this.latestCandles.complete(),this.candlesData=null,this.pairSelected=null}ngOnInit(){this._settingsService.getConfigChanged$("chart_resolution").subscribe(t=>this.chartResolution=t),this._settingsService.getConfigChanged$("chart_type").subscribe(t=>this.chartTypeUrl=t),this._settingsService.getConfigChanged$("drawing_toolbars").subscribe(t=>this.drawingToolbarsActive=t),this._settingsService.getConfigChanged$("tv_pane_color").subscribe(t=>{let e=this.isDarkTheme?t.dark:t.light;this._chartService.setCustomBackgroundPaneColor(e)}),this._settingsService.getConfigChanged$("tv_platform_color").subscribe(t=>{let e=this.isDarkTheme?t.dark:t.light;this._chartService.setCustomBackgroundPlatformColor(e)}),this._settingsService.getConfigChanged$("chart_in_usd").subscribe(t=>{this._chartInUsd=t}),this._settingsService.onThemeChange$.pipe(pe(this._destroyRef),me(t=>{let e=t===0;return this.isDarkTheme!==e})).subscribe(t=>{this.isDarkTheme=t===0,this._themeService.switchTheme(t===0?"dark":"light")}),this._exchangeApiAdapter=this._exchangeApiService.getAdapter(this.chain),this._webSocketService.isConnected$().pipe(pe(this._destroyRef),H(t=>{t||(this._isSubscribed=!1),this.isWsConnected=t})).subscribe(),this._routeParamsSub=this._actRoute.params.subscribe(t=>{switch(this.chain){case"solana":{this._loadSolanaChainPair(t);break}case"aptos":{this._loadNonEvmChainPair(t,Lc);break}case"multiversx":{this._loadNonEvmChainPair(t,kc);break}case"osmosis":case"kujira":{this._loadNonEvmChainPair(t,Pc);break}case"ton":{this._loadNonEvmChainPair(t,Oc);break}case"near":{this._loadNonEvmChainPair(t,Mc);break}case"tron":{this._loadNonEvmChainPair(t,Nc);break}case"icp":{this._loadNonEvmChainPair(t,Fc);break}case"xrpl":{this._loadNonEvmChainPair(t,Vc);break}case"pawchain":{this._loadNonEvmChainPair(t,$c);break}case"qubic":{this._loadNonEvmChainPair(t,Uc);break}default:this._loadEvmChainPair(t)}})}_loadEvmChainPair(t){let i=(t.pairId||y.getDefaultPairByChain(this.chain)).toLowerCase().slice(0,tn);this.pairId=i,this.pairSelected=i,this._web3UtilsService.isLibLoaded$.subscribe(()=>{this._web3UtilsService.isAddress(i)?this.viewPair():this._navigateToDefaultPair()})}_loadSolanaChainPair(t){let i=(t.pairId||y.getDefaultPairByChain(this.chain)).slice(0,Dc);this.pairId=i,this.pairSelected=i,this._web3SolanaUtilsService.isLibLoaded$.subscribe(()=>{this._web3SolanaUtilsService.isAddress(i)?this.viewPair():this._navigateToDefaultPair()})}_loadNonEvmChainPair(t,e){let n=(t.pairId||y.getDefaultPairByChain(this.chain)).slice(0,e);this.pairId=n,this.pairSelected=n,y.isValidAddressForChain(this.chain,n)||y.isValidTokenAddressForChain(this.chain,n)?this.viewPair():this._navigateToDefaultPair()}viewPair(){let t=y.isEVMChain(this.chain)?this.pairId.toLowerCase():this.pairId;this.chartClientId=`${t}-${y.getLegacyChain(this.chain)}`,this._pairsService.getAllPairData(t,this.chain,!1,!1).pipe(pe(this._destroyRef),ge(()=>C(null)),H(e=>{(e==null||e.id.pair!==t)&&(this.tokenData.id=t)}),me(e=>{if(e?.id!=null){this._allPairData=e,this.tokenData.exchange=e.id.exchange||Mn,this.exchange=this.tokenData.exchange,this.exchangeVersion=Ve.getExchangeVersion(e.id.exchange,this.chain);let i=e.id.token,n=e.id.tokenRef;this._populateIntervalData(e),e.symbol&&(this.tokenData.symbol=yt.isStableNativePair(e.type)?Ae.safeText(e.symbolRef):Ae.safeText(e.symbol),this.tokenData.symbol===""&&(this.tokenData.symbol=e.symbol)),e.symbolRef&&(this.tokenData.symbol_vs=yt.isStableNativePair(e.type)?Ae.safeText(e.symbol):Ae.safeText(e.symbolRef),this.tokenData.id_vs=n,this.tokenRef=Ae.safeText(this.tokenData.symbol_vs)),i&&(this.tokenData.id=i),e.name&&(this.tokenData.name=Ae.safeText(e.name||"")),e.token?.decimals&&(this.tokenData.decimals=+e.token.decimals),e.type=e.type??"standard-pair",this.tokenData.pairType=e.type}return!0})).subscribe(()=>{this.abortDataTransactions$.next(!1),this._continueTxData(this.pairSelected,{result:this._transactionsBuffer}),this._isPairLoaded$.pipe(pe(this._destroyRef),me(e=>!!e),zi(100),H(()=>se(this,null,function*(){if(this._dataTransactions.length>0){let e=this._dataTransactions[this._dataTransactions.length-1].timestamp,i=this._dataTransactions.filter(n=>n.timestamp===e);this.candlesData?yield this._updateCandlesWithLiveSwaps(i.reverse()):(this.candlesData=this._candlesDataService.getCandlesData(t,this.chartTokenData.symbol,this.chartTokenData.isStableSymbol),yield this._updateCandlesWithLiveSwaps(this._dataTransactions))}this._emitLatestPrice()}))).subscribe(),this.abortDataTransactions$.pipe(pe(this._destroyRef),H(e=>{e||this._retryTxCall(this._timePetitionsTx)})).subscribe(),this.candlesData=this._candlesDataService.getCandlesData(t,this.chartTokenData.symbol,this.chartTokenData.isStableSymbol),this._chartInUsd||this.candlesData.setChartTokenRef("eth"),this.candlesData.setResolution(he.transformToNumericResolution(this._candlesDataService.latestResolution)),this.pairSelected=t,this.loaderTv=!1,this._commonService.coinPrice$.pipe(ie(1)).subscribe(e=>{e>0&&this.initialRequest(this.pairSelected)})})}_pairSubscribe(t){this._transactionsBuffer=[],this._webSocketService.listenWebSocket(`${this._chainData.chainPrefix}${Z1}${t}`,{chain:this.chain}).pipe(me(e=>e.event==="swaps"),me(e=>e.id===this.pairSelected&&!!e.swaps),R(e=>e.swaps),El(500),R(e=>[].concat(...e)),me(e=>e.length>0),pe(this._destroyRef),H(e=>se(this,null,function*(){this.loader?this._transactionsBuffer=[...this._transactionsBuffer,...e]:yield this._processLiveSwaps(e)}))).subscribe({complete:()=>this._isSubscribed=!1}),this._isSubscribed=!0}_continueTxData(t,e){this.initCharge&&this._resetTimestampsUniqueTx();let i=Ui.removeDuplicateTransactions(Ui.filterBuysSellsOnly(e.result),this._dataTransactionsApi);i.length>0?(this._updateTimestampUniqueTx(i),this._dataTransactionsApi=[...this._dataTransactionsApi,...i],this._setTx(i)):this._prepareTokens(),this.initCharge?(this.initCharge=!1,this._fetchSwaps(t)):i.length>0?this.isSynced||this._fetchSwaps(t):(this.loader&&this._isPairLoaded$.next(!0),this.loader=!1,this._cdRef.detectChanges(),this._isSubscribed?this.isWsConnected||this.abortDataTransactions$.next(!1):this._pairSubscribe(t))}_setTx(t){if(t.length===0)return;let e,i=!0,n=t.length-this._numberOfTxShow;for(let[s,a]of t.entries())if(!this.initCharge||s>=n){a.maker=a.maker&&y.getMakerFormatByChain(a.maker,this.chain);let o=this.tokenData.isStableNativePair?a.amountRef:a.amountToken,l={indexedBlock:Ui.getIndexedBlock(a),timestamp:a.timestamp,type:a.type,priceUSD:a.price,priceUSD_ETH:a.priceETH,price:a.price,priceETH:a.priceETH,amountToken:o,amountETH:a.amountETH,amountUSD:o*a.price,maker:a.maker,id:a.id,blockNumber:a.blockNumber,blockHash:a.blockHash,logIndex:a.logIndex,others:a.others,frontRunning:void 0,amountRef:this.tokenData.isStableNativePair?a.amountToken:this.tokenRef?a.amountRef:""};l.logIndex==null?(i=!1,this._dataTransactionsTemp.push(l)):(i=!0,this._dataTransactionsTemp.unshift(l)),(!t[s+1]||a.timestamp!==t[s+1].timestamp)&&(e=this._dataTransactionsTemp[i?0:this._dataTransactionsTemp.length-1],this._dataTransactions=this._dataTransactions.concat(this._dataTransactionsTemp))}e?.price&&(this.tokenData.priceUSD=e.price,this.tokenData.priceETH=e.priceETH,this._optimalDecimalsUsd=ot.getOptimalDecimals(this.tokenData.priceUSD||0),this.loader=!1,this._recreateTokenData())}_resetTimestampsUniqueTx(){this._lastTimestamp=0,this._lastTimestampOffset=0,this._lastTimestampUniqueTrx=[]}_updateTimestampUniqueTx(t){for(let e of t)this._lastTimestamp===+e.timestamp&&!this._lastTimestampUniqueTrx.includes(e.id+e.maker+e.amountToken)?(this._lastTimestampOffset++,this._lastTimestampUniqueTrx.push(e.id+e.maker+e.amountToken)):this._lastTimestamp<+e.timestamp&&(this._lastTimestampOffset=0,this._lastTimestampUniqueTrx=[e.id+e.maker+e.amountToken],this._lastTimestamp=+e.timestamp)}_setTokenAndPoolData(t){if(t){this.tokenData.isStableNativePair=yt.isStableNativePair(t.type),this.tokenData.pooledToken=t.metrics.reserve,this.tokenData.pooledETH=t.metrics.reserveRef,this._populateIntervalData(t),this.tokenData.pooledToken==null&&(this.tokenData.pooledToken=t.metrics.reserveRef||"",this.tokenData.pooledETH=t.metrics.reserve||""),(y.isStableSymbol(this.chain,this.tokenData.symbol??null)||y.isChainSymbol(this.chain,this.tokenData.symbol_vs??null))&&(this.tokenRef=""),t.token.logo!=null&&t.token.logo!==""&&(this.tokenData.logo=yt.normalizeLogoUrl(t.token.logo));let e=$i.getTokenPoolInfo(t,this.tokenPoolInfo);this.tokenPoolInfo={circulatingSupply:e.circulatingSupply,marketCap:e.marketCap,totalMarketCap:e.totalMarketCap,vol24h:e.vol24h}}this._recreateTokenData()}initialRequest(t){this._exitComponent||this._fetchPoolData(t)}_fetchPoolData(t){let e=this._pairsService.getAllPairData(t,this.chain,!1,!1).pipe(pe(this._destroyRef),Rl(s=>s.pipe(Wi(Vh),pe(this._destroyRef)))),i,n={next:s=>{this._allPairData=s,this._setTokenAndPoolData(s),this.initCharge&&!this._isPoolLoaded&&(this._isPoolLoaded=!0,this._fetchSwaps(t))},error:()=>{console.error("There was an error while trying to obtain pool data")}};this._allPairData==null?i=e:i=C(this._allPairData).pipe(ee(s=>(n.next(s),Pe(Vh).pipe(pe(this._destroyRef)))),ie(1),ee(()=>e)),i.pipe(pe(this._destroyRef)).subscribe(n)}_populateIntervalData(t){this.tokenData.price=t.price,this.tokenData.price24h=t.price24h,this.priceVariation24h=$i.getPriceVariation(this.tokenData.price,this.tokenData.price24h?.price),this._cdRef.detectChanges()}_fetchSwaps(t){this._exchangeApiAdapter.getSwaps(this.pairSelected,`${this._lastTimestamp}-${this._lastTimestampOffset}`).pipe(pe(this._destroyRef),Sr(e=>e.pipe(pe(this._destroyRef),ke(()=>{if(t===this.pairSelected)return this.noTransactions=!0,Pe(5e3).pipe(pe(this._destroyRef));throw new Error("Multichart: fetching of swaps aborted")})))).subscribe({next:e=>{this._reconnTimes=0,this._allPairData&&this._allPairData.id.token&&this._allPairData.symbol&&this._setTokenAndPoolData(this._allPairData),e?(this.noTransactions=!1,e.result&&this.tokenData.symbol?this._continueTxData(t,e):this.loader&&(this._isPairLoaded$.next(!0),this.loader=!1,this._cdRef.detectChanges())):Pe(this._timePetitionsTxRecon).pipe(pe(this._destroyRef)).subscribe(()=>{this.initialRequest(this.pairSelected)})},error:()=>{this._reconnTimes>=this._maxReconnTimes&&(this.loader=!1,this._cdRef.detectChanges()),this._reconnTimes++,Pe(this._timePetitionsTxRecon).pipe(pe(this._destroyRef)).subscribe(()=>{this.initialRequest(this.pairSelected)})}})}_processLiveSwaps(t){return se(this,null,function*(){this._addSwaps(t,this.pairSelected),this.candlesData&&(yield this._updateCandlesWithLiveSwaps(t)),this._emitLatestPrice()})}_updateCandlesWithLiveSwaps(t){return se(this,null,function*(){let e=[...t];if(this._bufferLiveSwapsUntilChartReady()?this._swapsReceivedBeforeChartReady=[...this._swapsReceivedBeforeChartReady,...e]:this._swapsReceivedBeforeChartReady.length>0&&(e=[...this._swapsReceivedBeforeChartReady,...e],this._swapsReceivedBeforeChartReady=[]),e.length>0&&this.candlesData){let i=yield this._candlesDataService.updateWithLiveSwaps(this.candlesData,e,!0,!0,this._bufferLiveSwapsUntilChartReady());i&&i.length>0&&this._emitLiveCandles(i)}})}_addSwaps(t,e){t.length>0&&this._dataTransactions.length>0&&this._dataTransactions[this._dataTransactions.length-1].timestamp>t[t.length-1].timestamp?this._addReorgSwaps(e,t):this._continueTxData(e,{result:t})}_addReorgSwaps(t,e){let i=[...this._dataTransactions,...e].sort((s,a)=>s.timestamp===a.timestamp?s.logIndex-a.logIndex:s.timestamp-a.timestamp),n=Ui.removeDuplicateTransactions(i,this._dataTransactionsApi);this._continueTxData(t,{result:n})}_prepareTokens(){if(this.initCharge){let t=+this.tokenData.pooledETH/+this.tokenData.pooledToken,e=+this._commonService.getPriceETH()*t;this.tokenData.priceETH=t,this.tokenData.priceUSD=e,this._recreateTokenData()}}_recreateTokenData(){this.tokenData=f({},this.tokenData),this.chartTokenData={symbol:this.tokenData.symbol??"",isStableSymbol:y.isStableSymbol(this.chain,this.tokenData.symbol??null),created:this.tokenData.created,supply:this.tokenPoolInfo.circulatingSupply??this.tokenPoolInfo.totalSupply},this._cdRef.detectChanges()}_retryTxCall(t){Pe(t).pipe(pe(this._destroyRef)).subscribe(()=>{this.initialRequest(this.pairSelected)})}_emitLiveCandles(t){this.latestCandles.next(t),this.latestCandles.next([])}_emitLatestPrice(){if(this.pairSelected&&this._dataTransactions.length>0){let t=this._dataTransactions[this._dataTransactions.length-1];this._priceTrackService.updatePairPrice(this.chain,{eth:t.priceETH,usd:t.price,id:this.pairSelected,ts:t.timestamp})}}openFullScreen(t){this.isFullScreen=t,this._cdRef.detectChanges()}registerWidget(t,e){this._pairTV={componentInstance:e,widgetInstance:t},this._pairTV.widgetInstance?.onChartReady(()=>{this._bufferLiveSwapsUntilChartReady.set(!1)})}unregisterWidget(t){this._pairTV={componentInstance:t}}_storeChartSetting(t,e){let i=t===sl?sl:`${$h}.${t}`;typeof e=="string"?ne.setString(i,e):ne.set(i,e)}_getStoredChartSetting(t){let e=`${$h}.${t}`;return t==="resizedHeight"?ne.getString(e):t===sl?ne.get(t):ne.get(e)}_navigateToDefaultPair(){this._routingService.navigate(`/${this.chain}/pe-light/${this._chainData.defaultPair}`).then()}static{this.\u0275fac=function(e){return new(e||r)(S(Zs),S(Qs),S(Ne),S(Gs),S(bt),S(nn),S(In),S(jc),S(_t),S(Zt),S(gi),S(He),S(Ci),S(vi))}}static{this.\u0275cmp=Q({type:r,selectors:[["app-pairexplorer-light"]],hostBindings:function(e,i){e&1&&xe("mousedown",function(){return i.onMouseDown()})("click",function(s){return i.onDocumentClicked(s,s.target)},!1,wr)},standalone:!0,features:[zt([bt]),ue],decls:2,vars:1,consts:[["tvComponent",""],[3,"tokenData","priceVariation24h","language","isDarkTheme","chain","pairAddress"],[3,"liveCandlesCleared","fullScreenToggled","tvReady","tvDestroyed","chartApiAdapter","chartApiV2Adapter","chartSettingsStorage","showMarketCapButton","clientId","tokenData","refTokenSymbol","exchange","candlesData","pairSelected","latestCandles$","darkThemeUrl","lightThemeUrl","isFullScreen","isDarkTheme","isUserIdEnabled","showTokenRefChangeButton","showMinMaxButtons","chartResolution","chartType","showLeftToolbar","chain","secondsResolutionsEnabled"]],template:function(e,i){e&1&&(F(0,"p-card"),$(1,q1,3,29),O()),e&2&&(I(),wt(i.loaderTv?-1:1))},dependencies:[Cu,gh,fh,kr,js,ws,is],styles:["[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] app-trading-view[_ngcontent-%COMP%] .trading-view{height:calc(100% - 40px)!important}[_nghost-%COMP%] p-card[_ngcontent-%COMP%] .p-card{height:100%}[_nghost-%COMP%] p-card[_ngcontent-%COMP%] .p-card-body, [_nghost-%COMP%] p-card[_ngcontent-%COMP%] .p-card-content{padding:0;height:100%}[_nghost-%COMP%] .pair-explorer__external[_ngcontent-%COMP%]{text-decoration:none;display:flex;flex-flow:row-reverse;font-size:1.25rem;font-weight:600;line-height:1.2857142857rem;padding-left:0;padding-right:0}[_nghost-%COMP%] .pair-explorer__external[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .pair-explorer__external[_ngcontent-%COMP%]:focus{box-shadow:none}"],data:{animation:[cc("simpleFadeAnimation",[hc("*=>*",[uc({opacity:0}),dc(600)])])]},changeDetection:0})}};var al=r=>{let t=r.queryParams.chain,e=r.queryParams.pairId;return t==null&&r.params.chain!=null&&(t=r.params.chain),e==null&&r.params.pairId!=null&&(e=r.params.pairId),{chain:t??"",pairId:e??""}};var Js=(o=>(o[o.bar=0]="bar",o[o.candle=1]="candle",o[o.line=2]="line",o[o.area=3]="area",o[o.heikin_ashi=8]="heikin_ashi",o[o.hollow_candle=9]="hollow_candle",o[o.baseline=10]="baseline",o))(Js||{}),ea=["1","3","5","15","30","60","120","240","720","1D","3D","1W","1M"];var ol={tv_platform_color:{paramKey:"tvPlatformColor"},tv_pane_color:{paramKey:"tvPaneColor"}};var ll=r=>{let t=b(He),e=b(Ci);if(r.queryParams.theme==null)t.changeConfig({dark_theme:t.defaultConfigValue.dark_theme}),e.switchTheme("dark");else{let n=r.queryParams.theme==="dark"?"dark":"light";t.changeConfig({dark_theme:n==="dark"}),e.switchTheme(n)}if(r.queryParams.chartType!=null){let n=r.queryParams.chartType;Js[+n]==null?(console.warn(`DEXTools Widget: invalid chartType defined: ${n}. Using chartType 1 by default.`),t.changeConfig({chart_type:1})):t.changeConfig({chart_type:+n})}if(r.queryParams.chartResolution!=null){let n=`${r.queryParams.chartResolution}`.toUpperCase();ea.includes(n)?t.changeConfig({chart_resolution:n}):(console.warn(`DEXTools Widget: invalid chartResolution defined: ${n}. Using chartResolution ${ea[0]} by default.`),t.changeConfig({chart_resolution:ea[0]}))}r.queryParams.drawingToolbars!=null&&t.changeConfig({drawing_toolbars:r.queryParams.drawingToolbars==="true"}),r.params.language!=null&&t.changeConfig({language:r.params.language}),r.queryParams.chartInUsd==="false"?t.changeConfig({chart_in_usd:!1}):t.changeConfig({chart_in_usd:!0});let i={light:t.defaultConfigValue.header_color?.light??"",dark:t.defaultConfigValue.header_color?.dark??"",isCustom:!1};if(r.queryParams.headerColor!=null){let n=r.queryParams.headerColor?`#${r.queryParams.headerColor}`:"";Ae.REGEX_HEX_COLOR.test(n)&&(e.getTheme()===0?i.dark=n:i.light=n,i.isCustom=!0,document.documentElement.style.setProperty("--custom-header-bg",n),document.documentElement.style.setProperty("--custom-header-border-color",n))}t.changeConfig({header_color:i});for(let n of Object.keys(ol)){let s={light:t.defaultConfigValue[n]?.light??"",dark:t.defaultConfigValue[n]?.dark??"",isCustom:!1},a=ol[n].paramKey;if(r.queryParams[a]!=null){let o=r.queryParams[a]?`#${r.queryParams[a]}`:"";Ae.REGEX_HEX_COLOR.test(o)&&(e.getTheme()===0?s.dark=o:s.light=o,s.isCustom=!0)}t.changeConfig({[n]:s})}return"settings resolved"};var cl=()=>{let r=b(He),t=b(_n),e=t.currentLang===r.language,i=Object.keys(t.translations).length>0,n=e&&i,s=C(!0);return n||(t.setDefaultLang(r.language),s=t.use(r.language).pipe(R(()=>!0))),s};var dl=(r,t)=>{let e=b(gi),i=Pt.getCurrentStoredLanguage("dextools-widget-config"),n=r.params.language;if(!Pt.languageList.includes(n)){let s=t.url.replace(`/${n}`,`/${i}`);return e.navigate(s).then(),!1}return!0};var Uh="pancakeswap",Bh="quickswap",X1="uniswap",Y1="sushiswap",ta=class r{constructor(t,e){this._router=t;this._settingsService=e;this.canActivate=(t,e)=>{let i=this.convertLegacyUrl(e.url);return i||!0};this.canActivateBeta=(t,e)=>{let i=this.convertLegacyUrl(e.url,!1);return i||!0}}convertLegacyUrl(t,e=!0){let i=en;if(!t.match(`/(${i.join("|")})(.*)`)){let s=[...Nn,Ea,Ac,Aa,Ra,Uh,Bh,X1,Y1],a=t.match(`/(${s.join("|")})(.*)`)||[],o="ether",l=a[2]??"";if(a.length>0)switch(a[1]){case Uh:{o="bnb";break}case Bh:{o="polygon";break}case Ea:{o="oktc";break}case Aa:{o="viction";break}case Ra:{o="kaia";break}default:{a[1].match(`${Nn.join("|")}`)&&(o=y.replaceLegacyChain(a[1]));break}}let[c,d]=l.split("?"),u=`${e?`/${this._settingsService.language}`:""}/${o}${c}`,h={};return d&&d.split("&").forEach(p=>{let[m,A]=p.split("=");m&&(h[m]=A||"")}),this._router.createUrlTree([u],{queryParams:Object.keys(h).length>0?h:void 0})}return null}static{this.\u0275fac=function(e){return new(e||r)(D(tt),D(He))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};var ul=(r,t)=>{let e=b(ta),i=b(gi),n=e.convertLegacyUrl(t.url);if(n)return n;let s=r.params.chain;return y.isValidChain(s)?!0:(i.navigate(""),!1)};var Hh=[{path:":language/:chain/pe-light",children:[{path:":pairId",component:fr,canActivate:[ul,dl],resolve:{currentSettings:ll,currentPair:al,translationsLoaded:cl}},{path:"",component:fr,canActivate:[ul,dl],resolve:{currentSettings:ll,currentPair:al,translationsLoaded:cl}}]}];var jh=Pt.getCurrentStoredLanguage("dextools-widget-config"),zh=[{path:"",pathMatch:"full",redirectTo:`${jh}/ether/pe-light`},{path:":language",pathMatch:"full",redirectTo:":language/ether/pe-light"},{path:":language/:chain",pathMatch:"full",redirectTo:":language/:chain/pe-light"},...Hh,{path:"**",redirectTo:`${jh}/ether/pe-light`}];var hl="#111827",ia=class extends He{constructor(e,i,n,s,a){super(e,i,n,s,a);this._defaultConfigValue={language:Pt.supportNavigationLanguage,dark_theme:!0,notifications:!1,notificationsLogoUrl:"assets/img/logo/dextools_logo.png",notificationsAudioUrl:"assets/sounds/notification.mp3",chart_type:1,chart_resolution:"1",drawing_toolbars:!0,chart_in_usd:!0,header_color:{light:"#f8f9fa",dark:hl,isCustom:!1},tv_pane_color:{light:"#ffffff",dark:hl,isCustom:!1},tv_platform_color:{light:"#ffffff",dark:hl,isCustom:!1}};this._localStorageConfigKey="dextools-widget-config"}};var na=class{http;prefix;suffix;constructor(t,e="/assets/i18n/",i=".json"){this.http=t,this.prefix=e,this.suffix=i}getTranslation(t){return this.http.get(`${this.prefix}${t}${this.suffix}`)}};function Wh(r,t){return new na(r,"./assets/i18n/",`.json?cb=${t.appVersion.toLowerCase().split(" ").join(".")}`)}function Q1(r){r.__load_patch("Error",(t,e,i)=>{let n=i.symbol("zoneJsInternalStackFrames"),s=t[i.symbol("Error")]=t.Error,a={},o,l,c,d,u;t.Error=_;let h="stackRewrite",p=t.__Zone_Error_BlacklistedStackFrames_policy||t.__Zone_Error_ZoneJsInternalStackFrames_policy||"default";function m(P){let N={zoneName:P.zone.name},G=N;for(;P.parent;){P=P.parent;let K={zoneName:P.zone.name};N.parent=K,N=K}return G}function A(P,N,G=!0){let K=P.split(` `),le=0;for(;!(K[le]===o||K[le]===l||K[le]===c||K[le]===d||K[le]===u)&&le{let K=P[G];if(K!==void 0)try{this[G]=K}catch{}}),this):P}_.prototype=s.prototype,_[n]=a,_[h]=!1;let x=i.symbol("zoneAwareStack");p==="lazy"&&Object.defineProperty(_.prototype,"zoneAwareStack",{configurable:!0,enumerable:!0,get:function(){return this[x]||(this[x]=A(this.originalStack,this[i.symbol("zoneFrameNames")],!1)),this[x]},set:function(P){this.originalStack=P,this[x]=A(this.originalStack,this[i.symbol("zoneFrameNames")],!1)}});let k=["stackTraceLimit","captureStackTrace","prepareStackTrace"],U=Object.keys(s);U&&U.forEach(P=>{k.filter(N=>N===P).length===0&&Object.defineProperty(_,P,{get:function(){return s[P]},set:function(N){s[P]=N}})}),s.hasOwnProperty("stackTraceLimit")&&(s.stackTraceLimit=Math.max(s.stackTraceLimit,15),Object.defineProperty(_,"stackTraceLimit",{get:function(){return s.stackTraceLimit},set:function(P){return s.stackTraceLimit=P}})),s.hasOwnProperty("captureStackTrace")&&Object.defineProperty(_,"captureStackTrace",{value:function(N,G){s.captureStackTrace(N,G)}});let Y="zoneCaptureStackTrace";if(Object.defineProperty(_,"prepareStackTrace",{get:function(){return s.prepareStackTrace},set:function(P){return!P||typeof P!="function"?s.prepareStackTrace=P:s.prepareStackTrace=function(N,G){if(G){for(let K=0;K{De.runGuarded(()=>{let P=()=>{};De.scheduleEventTask(n,()=>{De.scheduleMacroTask(n,()=>{De.scheduleMicroTask(n,()=>{throw new Error},void 0,N=>{N._transitionTo=P,N.invoke()}),De.scheduleMicroTask(n,()=>{throw Error()},void 0,N=>{N._transitionTo=P,N.invoke()})},void 0,N=>{N._transitionTo=P,N.invoke()},()=>{})},void 0,N=>{N._transitionTo=P,N.invoke()},()=>{})})}),Error.stackTraceLimit=ye})}Q1(Zone);var fl="1.0.0",gl="Pair Explorer Light",_l=!0,Gh="localhost",ra="",ri=`http://${Gh}`,J1=`${ri}${ra}`,e_=`${ri}:3030/back`,t_=`${ri}:3020`,i_="#",n_=ri,r_="https://auth-api-dev.dextools.io",s_="https://user-api-dev.dextools.io";var pl={};for(let r of Ko.values())pl[`api_${r[0]}_url`]=`${ri}:${r[1]}/api`;function gr(r,t){if(/ether/.test(r))return t.api_ethereum_url;let e=`api_${r}_url`;return t[e]}function a_(r){return{token:{update:(t,e,i,n,s)=>{let a=s?`&volume=${s}`:"",o=n?`&txCount=${n}`:"";return`${gr(t,r)}/token/holders?pair=${e}&token=${i}${a}${o}`},audit:(t,e,i=!1)=>`${gr(t,r)}/token/audit?token=${e}&force=${i}`},tokenNews:{save:`${gr("ethereum",r)}/token-news/save`,all:`${gr("ethereum",r)}/token-news/all`,status:`${gr("ethereum",r)}/token-news/status`}}}var ml=class{constructor(){this.appTitle=gl;this.externalLink=_l;this.allowAdmin=!0;this.app_scope=ra;this.appUrl=J1;this.host=ri;this.assets_url=`${ri}${ra}/assets`;this.appLogo=`${ri}${ra}/assets/img/logo/dextools_logo_header_125.png`;this.apiUrls=f({},pl);this.back_url=e_;this.meta_url=`${ri}:3030/meta`;this.ws_url=`ws://${Gh}:8050`;this.paths=a_(pl);this.production=!1;this.whitelistedUrls=[];this.siteId="";this.appVersion=fl;this.shared_url=t_;this.cf_proxy_url=i_;this.core_api_url=n_;this.auth_api_url=r_;this.user_api_url=s_;this.featureFlags={newAuth:!1}}},j4=new ml;var o_="www.dextools.io",Kh="/widget-chart",Nt=`https://${o_}`,Cl=`${Nt}${Kh}`,l_=`${Nt}/shared`,c_="#",d_="https://core-api.dextools.io";var u_="https://auth-api-dev.dextools.io",h_="https://user-api-dev.dextools.io",Bi={};for(let r of Go)switch(r){case"bnb":{Bi[`api_${r}_url`]=`${Nt}/chain-bsc/api`;break}case"oktc":{Bi[`api_${r}_url`]=`${Nt}/chain-oec/api`;break}case"multiversx":{Bi[`api_${r}_url`]=`${Nt}/chain-elrond/api`;break}case"viction":{Bi[`api_${r}_url`]=`${Nt}/chain-tomo/api`;break}case"kaia":{Bi[`api_${r}_url`]=`${Nt}/chain-klaytn/api`;break}default:Bi[`api_${r}_url`]=`${Nt}/chain-${r}/api`}var vl=class{constructor(){this.appTitle=gl;this.externalLink=_l;this.allowAdmin=!1;this.app_scope=Kh;this.appUrl=Cl;this.host=Nt;this.assets_url=`${Cl}/assets`;this.appLogo=`${Cl}/assets/img/logo/dextools_logo_header_125.png`;this.apiUrls=f({},Bi);this.back_url=`${Nt}/back`;this.meta_url=`${Nt}/meta`;this.ws_url="wss://ws.dextools.io/";this.paths=void 0;this.production=!0;this.whitelistedUrls=[];this.siteId="4";this.appVersion=fl;this.shared_url=l_;this.cf_proxy_url=c_;this.core_api_url=d_;this.auth_api_url=u_;this.user_api_url=h_;this.featureFlags={newAuth:!1}}},It=new vl;var sa=class r{constructor(t,e,i,n,s){this._authenticationService=t;this._webSocketService=e;this._settingsService=i;this._themesService=n;this._configPagesService=s}init(t){return C(!0).pipe(H(()=>{this._authenticationService.initialize(!1),this._webSocketService.initialize(),this._settingsService.initialize(t),this._themesService.initialize(t)}),ee(()=>this._configPagesService.fetchConfigFromPage$("features_app")))}static{this.\u0275fac=function(e){return new(e||r)(D(Pr),D(nn),D(He),D(Ci),D(vi))}}static{this.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}};function p_(r,t,e,i){return new ia(r,t,e,i,!0)}function m_(r,t){return()=>r.init(t)}function f_(r){return()=>{r.addIcons([eh])}}It.production&&void 0;oc(Es,{providers:[rc(sc()),zc(),Md(zh),ql({eventCoalescing:!0}),Ol(is.forRoot({loader:{provide:hi,useFactory:Wh,deps:[nc,Dt]}})),{provide:Dt,useValue:It},{provide:He,useFactory:p_,deps:[Ai,_n,cs,qi]},{provide:Zi,useFactory:m_,deps:[sa,fe],multi:!0},{provide:Zi,useFactory:f_,deps:[Bs],multi:!0},{provide:mc,useValue:{appUrl:It.appUrl,core_api_url:It.core_api_url,user_api_url:It.user_api_url,auth_api_url:It.auth_api_url,apiUrls:It.apiUrls,back_url:It.back_url,meta_url:It.meta_url,shared_url:It.shared_url,solbot_api_url:"https://solbot-stage.dextools.io/",featureFlags:It.featureFlags}},{provide:Fi,useValue:{backgroundLight:"#ffffff",backgroundDark:"#111827"}}]}).catch(r=>{console.error(r)});export{m_ as initApp,f_ as initCustomIcons,p_ as settingsServiceFactory};